Thanks for Steve's informative inputs
Hi Shimon,
For html elements in non-absolute layout html page, we need to use
recursive script function to get their absolute postion on the whole page.
For example:
function getAbsoluteLeft(oNode)
{
var oCurrentNode = oNode;
var iLeft = 0;
while(oNode != null && oCurrentNode.tagName != "BODY" )
{
iLeft += oCurrentNode.offsetLeft;
oCurrentNode=oCurrentNode.offsetParent;
}
return iLeft;
}
function getAbsoluteTop(oNode)
{
var oCurrentNode = oNode;
var iTop = 0;
while(oNode != null && oCurrentNode.tagName != "BODY")
{
iTop += oCurrentNode.offsetTop;
oCurrentNode = oCurrentNode.offsetParent;
}
return iTop; }
However, such scripts also depend on the browser's script model support,
I've test the above functions on IE6 and it works. Hope also helps.
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)