DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Get Element's Offsets
Retrieves the element's offsets
//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com
function getOffset(o){
for(var r = {x: o.offsetLeft, y: o.offsetTop, h: o.offsetHeight, w: o.offsetWidth}; o = o.offsetParent; r.x += o.offsetLeft, r.y += o.offsetTop);
return r;
}




