Here's another version I've tried. This one works in Firefox, Opera, but not IE7
Code:
<html>
<head>
</head>
<body>
<p>lorum ipsum</p>
<table><tr><td>
<div id="sectiona">
Section A
</div>
<div id="sectionb">
<script type="text/javascript">
var sectionaposition = document.getElementById('sectiona');
function getRealTop(el) {
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
return yPos;
}
trueY = getRealTop(sectionaposition);
document.write(trueY);
</script>
</div>
</td></tr></table>
</body>
</html>
Bookmarks