Skip to content
Permalink
Browse files

Only fadeIn/Out or slideUp/Down elements that are already hidden/visi…

…ble (for #1051).
  • Loading branch information
jeresig committed Mar 18, 2007
1 parent 98b721d commit 36774226dd241ae104e10e8073a0586c50ae59ad
Showing with 4 additions and 4 deletions.
  1. +4 −4 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();
},

/**

0 comments on commit 3677422

Please sign in to comment.
You can’t perform that action at this time.