the error is in:
//Iframe top offset
function getOffsetTop(elm)
{
var mOffsetTop = elm.offsetTop;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent)
{
mOffsetTop += mOffsetParent.offsetTop;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetTop;
}
this only works as long as all offsets is relativ to its parent.
if not, like in my case, it adds the absoulutepositions of the parents.
how do i chande this:
mOffsetParent = mOffsetParent.offsetParent;
i want it to be like this:
if (???)
mOffsetParent = mOffsetParent.offsetParent;
else
mOffsetParent = null;
where the if (???), check if the cordinate in mOffsetParent are not absolute.