package
Get offset of a DOM Element or Range within the document
npm install document-offsetGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Get offset of a DOM Element or Range within the document.
$ npm install document-offset$ component install timoxley/offsetGet offset of an element within the document (relative to the top left of the document).
Example:
var offset = require('document-offset')
var target = document.getElementById('target')
console.log(offset(target))
// => {top: 69, left: 108}Code adapted from jQuery.
MIT