-
Notifications
You must be signed in to change notification settings - Fork 0
getOffset
Mike Byrne edited this page Jan 25, 2022
·
2 revisions
Get the current coordinates of a node, relative to the document, corrected by scroll. Uses getBoundingClientRect
- nothing
- node - required
- object:
{
top: 100,
left: 200,
bottom: 300,
right: 400,
width: 500,
height: 600
}
var node = document.getElementById('foo');
var offset = getOffset(node); // object
var offsetTop = getOffset(node).top; // number