B
Brett Foster
This must have been covered a million times, but I'll be damned if I can
find the right information. Right now I'm using the following code:
This is a function to recusively calculate the absolute position of an
object (because you can't do it directly?):
SomeObject.prototype.__calcOffset__ = function (node) {
if (node && node.offsetTop)
return node.offsetTop + this.__calcOffset__(node.offsetParent);
else
return 0;
}
The problem is that while it worked in a simple layout it's not working
well in other layouts. Any ideas?
Brett
find the right information. Right now I'm using the following code:
This is a function to recusively calculate the absolute position of an
object (because you can't do it directly?):
SomeObject.prototype.__calcOffset__ = function (node) {
if (node && node.offsetTop)
return node.offsetTop + this.__calcOffset__(node.offsetParent);
else
return 0;
}
The problem is that while it worked in a simple layout it's not working
well in other layouts. Any ideas?
Brett