/page-position

Retrieve the position of an element relative to the page.

Primary LanguageJavaScript

100% test coverage

page-position

Retrieve the position of an element relative to the page.

Returns an object describing a rendered element's top, right, bottom, and left distances from the document's polar origin.

Installation

Install via npm:

$ npm i page-position --save

Usage

var pagePosition = require('page-position');
pagePosition(document.getElementById('target'));