We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Get the current coordinates of a node, relative to the document, corrected by scroll. Uses getBoundingClientRect
getBoundingClientRect
{ 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