node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey ยป

anthonyshort-offset

offset

Get the xy offset of an element

Installation

$ component install anthonyshort/offset

API

offset(document.querySelector('#foo')).top
offset(document.querySelector('#bar')).left

License

MIT