> Great catch, Luke!
>
> 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) {
Thanks Klaus ;-)
And I agree, changing the order is even better.
(A little OT, but ...) Another change I'd like to see would be returning
values for multiple css properties at once if you pass an array of
property names (but still return the value when called for a single
property (with a string), for compatibility's sake):
$('p').css('font-size') -> '12px'
$('p').css(['font-size','line-height']) -> { fontSize: '12px',
lineHeight: '18px' }
For extra nerdy fun, the returned object could have a custom toString
method to build it into a cssText String:
$('p').css(['font-size','line-height']).toString() -> 'font-size:
12px; line-height: 18px; '
Here's a plugin that does just that :-)
http://jquery.lukelutman.com/plugins/css/
Luke
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/