utilizes.offset
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

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.

/utilizes.offset/

    Package Sidebar

    Install

    npm i utilizes.offset

    Weekly Downloads

    1

    Version

    1.1.10

    License

    MIT

    Unpacked Size

    2.74 kB

    Total Files

    5

    Last publish

    Collaborators

    • natqe3