I am very surprised to see that I can not use offset postion to find the real position of an element:
<script language=”JavaScript” type=”text/JavaScript”>
onload=function(){alert(document.getElementById(‘myid’).offsetLeft)}
</script>
…
<body>
<div id=”myid” align=”center”>bla</div>
</body>
The alert shows 0…
?
I was expected that the element should show his offsetLeft relative to it’s parent, which is body, but it does not… How the heck can I really find out the position of some element relative to the body? Generally speaking, to retreive the position relative to the body, nomatter the other container parents which that element might have?