utilizes.offset
v1.1.10
Published
Get the current offset of the given element
Downloads
2
Readme
offset
Get the current offset of the given element
Usage: offset(item: Element | Partial<ClientRect> | Partial<DOMRect>): { top: number, left: number }
import { offset } from 'utilizes.offset'
const specialElement = document.getElementById('special-element')
offset(specialElement)
// Output the offset top and offset left of given element
offset(specialElement.getBoundingClientRect())
// also work
This module exported from utilizes project.