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

0.0.4 • 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

Package Sidebar

Install

npm i composed-offset-position

Weekly Downloads

58,548

Version

0.0.4

License

MIT

Unpacked Size

15.9 kB

Total Files

10

Last publish

Collaborators

  • jcfranco