composed-offset-position
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

composed-offset-position

This provides a set of ponyfills to achieve the same behavior of offsetParent, offsetLeft and offsetTop before the offsetParent spec was changed.

Installation

Using npm:

$ npm i --save-dev composed-offset-position

Usage

import { offsetLeft, offsetParent, offsetTop } from "composed-offset-position";

console.log(offsetLeft(element));
// ➡️ 0
console.log(offsetTop(element));
// ➡️ 20

console.log(offsetParent(element));
// ➡️ [object HTMLDivElement]

Notes

/composed-offset-position/

    Package Sidebar

    Install

    npm i composed-offset-position

    Weekly Downloads

    122,580

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    16.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • jcfranco