I found a weird problem when using Position.cumulativeOffset in Internet Explorer (tested on 6.0 and 7.0).
The function, under certain circumstances which I could not determine exactly, crashes returning an Exception (no value) if using IE. The exact point where it crashes is the line:
element.offsetParent
As I've said, doesn't return a value but an Exception, so the workaround I applied to "solve" the problem is simply adding a try/catch block like this:
cumulativeOffset: function(element) {
var valueT = 0, valueL = 0;
try
{
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
} while (element);
return [valueL, valueT];
}
catch(err)
{
return [valueL, valueT];
}
}
and then the function _always_ works as expected.
I know I'm not giving too many details, is all I could find after some hours of testing. If you find the real problem or add this try/catch workaround in the next release I would be pleased (and as far as I know, this workaround only could help others, as the function works exactly the same).
Thank you.