Revision: 24902
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 15, 2010 12:01 by iTony
Initial Code
function getElementTopLeft(id) { var ele = document.getElementById(id); var top = 0; var left = 0; while(ele.tagName != "BODY") { top += ele.offsetTop; left += ele.offsetLeft; ele = ele.offsetParent; } return { top: top, left: left }; }
Initial URL
Initial Description
Initial Title
element top, left position
Initial Tags
javascript
Initial Language
JavaScript