Skip to content

jcfranco/composed-offset-position

 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 50.5%
  • TypeScript 33.8%
  • JavaScript 14.9%
  • Shell 0.8%