aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-03-18 18:52:09 +0000
committerJohn Resig <jeresig@gmail.com>2007-03-18 18:52:09 +0000
commit36774226dd241ae104e10e8073a0586c50ae59ad (patch)
tree9bb4357da11346282566585630fe0574ddd5bb25 /src
parent98b721d27f95f73e4edb6a284ae3096592a93207 (diff)
downloadjquery-36774226dd241ae104e10e8073a0586c50ae59ad.tar.gz
jquery-36774226dd241ae104e10e8073a0586c50ae59ad.zip
Only fadeIn/Out or slideUp/Down elements that are already hidden/visible (for #1051).
Diffstat (limited to 'src')
-rw-r--r--src/fx/fx.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fx/fx.js b/src/fx/fx.js
index 933c9bf40..59cdceac5 100644
--- a/src/fx/fx.js
+++ b/src/fx/fx.js
@@ -143,7 +143,7 @@ jQuery.fn.extend({
* @see slideToggle(String|Number,Function)
*/
slideDown: function(speed,callback){
- return this.animate({height: "show"}, speed, callback);
+ return this.filter(":hidden").animate({height: "show"}, speed, callback).end();
},
/**
@@ -168,7 +168,7 @@ jQuery.fn.extend({
* @see slideToggle(String|Number,Function)
*/
slideUp: function(speed,callback){
- return this.animate({height: "hide"}, speed, callback);
+ return this.filter(":visible").animate({height: "hide"}, speed, callback).end();
},
/**
@@ -222,7 +222,7 @@ jQuery.fn.extend({
* @see fadeTo(String|Number,Number,Function)
*/
fadeIn: function(speed, callback){
- return this.animate({opacity: "show"}, speed, callback);
+ return this.filter(":hidden").animate({opacity: "show"}, speed, callback).end();
},
/**
@@ -248,7 +248,7 @@ jQuery.fn.extend({
* @see fadeTo(String|Number,Number,Function)
*/
fadeOut: function(speed, callback){
- return this.animate({opacity: "hide"}, speed, callback);
+ return this.filter(":visible").animate({opacity: "hide"}, speed, callback).end();
},
/**