N
Nodlehs
I am using this function to determine the absolute vertical location of
an element in my pages.
function getYPos(element)
{
var yPos = 0;
var elementIterator = element;
while (elementIterator)
{
yPos += elementIterator.offsetTop
elementIterator = elementIterator.offsetParent;
}
return yPos;
}
Now, when I call this, in FF(1.5.0.6) I get a pixel above the element I
pass.
In another machine, FF(1.5.0.1) I get the top most pixel of the element
I pass.
In IE 6 I get the top most pixel of the element I pass.
Can anyone explain to me why I possibly get different values on
different browsers? I have tried it on multiple machines with
FF(1.5.0.6) and get the same result. Any help would be much
appreciated.
Thanks,
Ken.
an element in my pages.
function getYPos(element)
{
var yPos = 0;
var elementIterator = element;
while (elementIterator)
{
yPos += elementIterator.offsetTop
elementIterator = elementIterator.offsetParent;
}
return yPos;
}
Now, when I call this, in FF(1.5.0.6) I get a pixel above the element I
pass.
In another machine, FF(1.5.0.1) I get the top most pixel of the element
I pass.
In IE 6 I get the top most pixel of the element I pass.
Can anyone explain to me why I possibly get different values on
different browsers? I have tried it on multiple machines with
FF(1.5.0.6) and get the same result. Any help would be much
appreciated.
Thanks,
Ken.