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.
Install via npm:
$ npm i page-position --save
var pagePosition = require('page-position');
pagePosition(document.getElementById('target'));