visible-part-of
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

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.

Package Sidebar

Install

npm i visible-part-of

Weekly Downloads

13

Version

1.1.10

License

MIT

Unpacked Size

3.52 kB

Total Files

5

Last publish

Collaborators

  • natqe3