is there any way at all i can get the current absolute position of an element?
for example:
<table>
<tr>
<td>fred</td>
<td><div style="position:absolute;">something</div></td>
</tr>
</table>
can i now get the position of the div in left,top terms?
absolute positions
Moderator: General Moderators
Well, if you modify your code slightly like this:
You should be able to get the information like this:
I'd check this out to learn more:
http://msdn.microsoft.com/library/defau ... erties.asp
Code: Select all
<table>
<tr>
<td>fred</td>
<td><div style="position:absolute;" id="myDiv">something</div></td>
</tr>
</table>Code: Select all
var divTop = document.getElementById('myDiv').style.top;
var divLeft = document.getElementById('myDiv').style.left;
var divRight = document.getElementById('myDiv').style.right;http://msdn.microsoft.com/library/defau ... erties.asp