visible-part-of
v1.1.10
Published
Get the current x and y of given element. also return the offset.
Downloads
20
Maintainers
Readme
visiblePartOf
Get the current x and y of given element. also return the offset.
Usage: visiblePartOf(element: HTMLElement): { x: number, y: number, offsetTop: number, offsetLeft: number }
import { visiblePartOf } from 'visible-part-of'
const specialElement = document.getElementById('special-element')
visiblePartOf(specialElement)
// Output the x and y of the element, also give you information about the current offset top and left
This module exported from utilizes project.