13 lines
No EOL
290 B
JavaScript
13 lines
No EOL
290 B
JavaScript
export default function getBoundingClientRect(element) {
|
|
var rect = element.getBoundingClientRect();
|
|
return {
|
|
width: rect.width,
|
|
height: rect.height,
|
|
top: rect.top,
|
|
right: rect.right,
|
|
bottom: rect.bottom,
|
|
left: rect.left,
|
|
x: rect.left,
|
|
y: rect.top
|
|
};
|
|
} |