Luke Lutman schrieb:
> Ok, I did a little bit of digging, and it looks like this is actually a
> bug. In the curCSS function, on line 452 (r627), there's a check
> for elem.currentStyle :
> 
> } else if(elem.currentStyle) {
> // stuff only ie should see
> }
> 
> Apparently, this property exists in Opera, but contains the bogus
> values. If that check is changed to:
> 
> } else if(elem.currentStyle && !window.opera) {
> 
> Then opera will use getComputedStyle and return the correct values, in 
> pixels :-)
> 
> I've submitted a ticket here:
> http://jquery.com/dev/bugs/bug/476/
> 
> Luke


Great catch, Luke!

Just in case other browser vendors include that as well for 
compatibility reasons (and because I read this recently: 
http://dev.opera.com/articles/view/using-capability-detection/) I 
propose the following: change the order of the if/else conditions from:

} else if (elem.currentStyle) {

} else if (document.defaultView && document.defaultView.getComputedStyle) {

to:

} else if (document.defaultView && document.defaultView.getComputedStyle) {

} else if (elem.currentStyle) {



-- Klaus


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to