global-offset
v0.1.7
Published
Element global offset
Downloads
4,039
Readme
global-offset
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 with top
and left
offsets.
element
Type: element
Element for calculate offsets.
Related
- coordinates — calculate relative coordinates
- is-pointer-inside — check if pointer is inside the element
- is-pointer-near — check if pointer is near the element
License
MIT