$().css("foo") now returns the value of $.css("foo") instead of setting to null.

This commit is contained in:
John Resig 2006-04-09 04:03:36 +00:00
parent 56992c6ad9
commit 4ab5a88bc4

15
jquery/jquery.js vendored
View file

@ -67,13 +67,14 @@ function $(a,c) {
}, },
css: function(a,b) { css: function(a,b) {
return this.each(function(){ return a.constructor != String || b ?
if ( !b ) this.each(function(){
for ( var j in a ) if ( !b )
$.attr(this.style,j,a[j]); for ( var j in a )
else $.attr(this.style,j,a[j]);
$.attr(this.style,a,b); else
}); $.attr(this.style,a,b);
}) : $.css( this.get(0), a );
}, },
toggle: function() { toggle: function() {
return this.each(function(){ return this.each(function(){