Node.js examples for DOM:Element
Get DOM Element Page Offset
function getDOMElementPageOffset ( elem ) { var x = 0;/*www .jav a 2 s . co m*/ var y = 0; for ( ; elem; elem = elem.offsetParent ) { // x += elem.offsetLeft - elem.scrollLeft; // y += elem.offsetTop - elem.scrollTop; x += elem.offsetLeft; y += elem.offsetTop; } return vec( x, y ); }