anthonyshort-offset

Get the x/y offset of an element

offset

Get the xy offset of an element

$ component install anthonyshort/offset
offset(document.querySelector('#foo')).top
offset(document.querySelector('#bar')).left

MIT