I have this neet code that I got from some helpful people on the list which gets the absolute position of a relatively positioned object including its parent objects.
The problem is that it works great on ie but not at all in Netscape. Anyone know why? Please help!!
heres the code:
function showmenu(elemName) {
if (document.getElementById) {
t = elemName.offsetTop;
l = elemName.offsetLeft;
tempelem = elemName;
while (tempelem.parentNode != null) {
tempelem = tempelem.parentNode;
t = t + tempelem.offsetTop;
l = l + tempelem.offsetLeft;
}
}
The problem is that it works great on ie but not at all in Netscape. Anyone know why? Please help!!
heres the code:
function showmenu(elemName) {
if (document.getElementById) {
t = elemName.offsetTop;
l = elemName.offsetLeft;
tempelem = elemName;
while (tempelem.parentNode != null) {
tempelem = tempelem.parentNode;
t = t + tempelem.offsetTop;
l = l + tempelem.offsetLeft;
}
}