Element global offset
Calculate offset of element with any position
property.
npm install --save global-offset
import offset from 'global-offset';
offset(document.querySelector('.hello')); // {left: 150, top: 0}
Return object with top
and left
offsets.
Type: element
Element for calculate offsets.
- coordinates — calculate relative coordinates
- is-pointer-inside — check if pointer is inside the element
- is-pointer-near — check if pointer is near the element
MIT