@odopod/odo-helpers
Version:
A collection of helper methods for Odo projects.
12 lines (11 loc) • 335 B
JavaScript
/**
* Gets the height and with of an element when the display is not none.
* @param {HTMLElement} element Element to get size of.
* @return {!{width: number, height: number}} Object with width/height.
*/
export default function getSize(element) {
return {
width: element.offsetWidth,
height: element.offsetHeight,
};
}