1.1.10 • Published 3 years ago

visible-part-of v1.1.10

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

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.