When using the latest version of Opera(9.10), the results from Position.realOffset do not reflect the real scroll offsets. This is because Opera appears to be putting the offsetTop and offsetLeft values into the scrollTop and scrollLeft attributes for some elements.
This can easily be verified by creating a table in html and outputing the scrollLeft and scrollTop attributes of various elements using javascript. Fooling around with the borders and cellspacing causes the scrollLeft and scrollTop values to shift around nicely. In my case this was happening on TR and TBODY elements and SPANs.
This is what I did to fix it in my code, but I didn't test the accuracy of the results with an element that has both scrollbars and a valid offsetLeft or offsetTop values.
realOffset: function(element) {
var valueT = 0, valueL = 0;
do {
if( !window.opera )
{
valueT += element.scrollTop || 0;
valueL += element.scrollLeft || 0;
}
else
{
var vT = element.scrollTop || 0;
var vL = element.scrollLeft || 0;
vT -= element.offsetTop || 0;
vL -= element.offsetLeft || 0;
if( vT > 0 )
valueT += vT;
if( vL > 0 )
valueL += vT;
}
element = element.parentNode;
} while (element);
return [valueL, valueT];
}