offset-in-viewport

Get offset of a dom element in the viewport

offset

Get offset of a dom element within the viewport.

$ component install timoxley/offset

Get offset of an element within the viewport.

Example:

var offset = require('offset')
var target = document.getElementById('target')
console.log(offset(target))
// => {top: 69, left: 108} 

Code adapted from jQuery.

MIT