Hi, I'm using prototype 1.6.0_rc1 and I noticed that for Firefox and IE the offsetLeft and offsetTop provided by those browsers is wrong in that it doesn't include borderWidths (Opera works perfectly however). For those two browsers this mostly fixes the problem:
CumulativeOffset: function( element ) {
var valueT = 0, valueL = 0;
do {
valueT += element.offsetTop || 0;
valueT += parseInt( Element.getStyle( element, 'borderTopWidth' ) ) || 0;
valueL += element.offsetLeft || 0 ;
valueL += parseInt( Element.getStyle( element, 'borderLeftWidth' ) ) || 0;
element = element.offsetParent;
} while (element);
return Element._returnOffset(valueL, valueT);
}
I say "mostly" because there is still an issue of pixelitis with IE (my offset is still off by 1 or 2 pixels, perhaps default padding or margin?). I suggest someone smarter than myself should implement the fix.