X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=jquery%2Fjquery.js;h=b9cb311ea29306281e26d897c687edc7a60177bf;hb=4233896e9d9e19e544df6a010b134faaf018cf5a;hp=59b6779fe67fae48557b2b469d3ae0cfb719d4f7;hpb=11e82e95b6d8542902bfd4d0d1394bed0d676946;p=jquery.git diff --git a/jquery/jquery.js b/jquery/jquery.js index 59b6779..b9cb311 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -1,7 +1,9 @@ /* - * jQuery (http://jquery.com/) - * By John Resig (http://ejohn.org/) - * Under an Attribution, Share Alike License + * jQuery (jquery.com) + * + * Copyright (c) 2006 John Resig (ejohn.org) + * Licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php * * $Date$ * $Rev$ @@ -67,13 +69,14 @@ function $(a,c) { }, css: function(a,b) { - return this.each(function(){ - if ( !b ) - for ( var j in a ) - $.attr(this.style,j,a[j]); - else - $.attr(this.style,a,b); - }); + return a.constructor != String || b ? + this.each(function(){ + if ( !b ) + for ( var j in a ) + $.attr(this.style,j,a[j]); + else + $.attr(this.style,a,b); + }) : $.css( this.get(0), a ); }, toggle: function() { return this.each(function(){ @@ -383,7 +386,7 @@ $.g = { checked: "a.checked" }, // TODO: Write getAttribute helper - ".": "$.hasWord(a.className||a.getAttribute('class'),m[2])", + ".": "$.hasWord(a,m[2])", "@": { "=": "$.attr(a,m[3]) == m[4]", "!=": "$.attr(a,m[3]) != m[4]",