git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56992c6
)
$().css("foo") now returns the value of $.css("foo") instead of setting to null.
author
John Resig
<jeresig@gmail.com>
Sun, 9 Apr 2006 04:03:36 +0000
(
04:03
+0000)
committer
John Resig
<jeresig@gmail.com>
Sun, 9 Apr 2006 04:03:36 +0000
(
04:03
+0000)
jquery/jquery.js
patch
|
blob
|
history
diff --git
a/jquery/jquery.js
b/jquery/jquery.js
index
66588f5
..
668a592
100644
(file)
--- a/
jquery/jquery.js
+++ b/
jquery/jquery.js
@@
-67,13
+67,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(){