1 | ;
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getElementPosition;
|
7 |
|
8 | /*
|
9 | * Finds element's position relative to the whole document,
|
10 | * rather than to the viewport as it is the case with .getBoundingClientRect().
|
11 | */
|
12 | function getElementPosition(element) {
|
13 | var rect = element.getBoundingClientRect();
|
14 | return {
|
15 | top: rect.top + window.pageYOffset,
|
16 | left: rect.left + window.pageXOffset
|
17 | };
|
18 | } |
\ | No newline at end of file |