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:
e50014d
)
Fix for #758
author
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Sun, 7 Jan 2007 23:38:37 +0000
(23:38 +0000)
committer
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Sun, 7 Jan 2007 23:38:37 +0000
(23:38 +0000)
src/fx/fx.js
patch
|
blob
|
history
diff --git
a/src/fx/fx.js
b/src/fx/fx.js
index
6dd3279
..
30bedbf
100644
(file)
--- a/
src/fx/fx.js
+++ b/
src/fx/fx.js
@@
-33,16
+33,18
@@
jQuery.fn.extend({
* @see hide(String|Number,Function)
*/
show: function(speed,callback){
* @see hide(String|Number,Function)
*/
show: function(speed,callback){
- return speed ?
- this.animate({
+ var hidden = this.filter(":hidden");
+ speed ?
+ hidden.animate({
height: "show", width: "show", opacity: "show"
}, speed, callback) :
height: "show", width: "show", opacity: "show"
}, speed, callback) :
- this.each(function(){
+ hidden.each(function(){
this.style.display = this.oldblock ? this.oldblock : "";
if ( jQuery.css(this,"display") == "none" )
this.style.display = "block";
});
this.style.display = this.oldblock ? this.oldblock : "";
if ( jQuery.css(this,"display") == "none" )
this.style.display = "block";
});
+ return this;
},
/**
},
/**
@@
-78,17
+80,19
@@
jQuery.fn.extend({
* @see show(String|Number,Function)
*/
hide: function(speed,callback){
* @see show(String|Number,Function)
*/
hide: function(speed,callback){
- return speed ?
- this.animate({
+ var visible = this.filter(":visible");
+ speed ?
+ visible.animate({
height: "hide", width: "hide", opacity: "hide"
}, speed, callback) :
height: "hide", width: "hide", opacity: "hide"
}, speed, callback) :
- this.each(function(){
+ visible.each(function(){
this.oldblock = this.oldblock || jQuery.css(this,"display");
if ( this.oldblock == "none" )
this.oldblock = "block";
this.style.display = "none";
});
this.oldblock = this.oldblock || jQuery.css(this,"display");
if ( this.oldblock == "none" )
this.oldblock = "block";
this.style.display = "none";
});
+ return this;
},
// Save the old toggle function
},
// Save the old toggle function