OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 722a8a9409f3bbe3da0a1c77d709d68cfb0a6705
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Get the outer sizes of the given element (offset size + margins)
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Object} object containing width and height properties
 */
export default function getOuterSizes(element) {
  const styles = getComputedStyle(element);
  const x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
  const y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
  const result = {
    width: element.offsetWidth + y,
    height: element.offsetHeight + x,
  };
  return result;
}