@codewell/html-element-screen-position

Calcualte the screen position of an html element.

Usage no npm install needed!

<script type="module">
  import codewellHtmlElementScreenPosition from 'https://cdn.skypack.dev/@codewell/html-element-screen-position';
</script>

README

@codewell/html-element-screen-position

Calcualte the screen position of an html element.

Installation

npm install @codewell/html-element-screen-position

Basic usage

import htmlElementScreenPosition from '@codewell/html-element-screen-position';

const htmlElement = // Get an element somehow

htmlElementScreenPosition(htmlElement)
// => {x: <some number>, y: <some number>}