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