anthonyshort-offset

Get the x/y offset of an element

Usage no npm install needed!

<script type="module">
  import anthonyshortOffset from 'https://cdn.skypack.dev/anthonyshort-offset';
</script>

README

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