Only fadeIn/Out or slideUp/Down elements that are already hidden/visible (for #1051).
This commit is contained in:
parent
98b721d27f
commit
36774226dd
|
@ -143,7 +143,7 @@ jQuery.fn.extend({
|
||||||
* @see slideToggle(String|Number,Function)
|
* @see slideToggle(String|Number,Function)
|
||||||
*/
|
*/
|
||||||
slideDown: function(speed,callback){
|
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)
|
* @see slideToggle(String|Number,Function)
|
||||||
*/
|
*/
|
||||||
slideUp: function(speed,callback){
|
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)
|
* @see fadeTo(String|Number,Number,Function)
|
||||||
*/
|
*/
|
||||||
fadeIn: function(speed, callback){
|
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)
|
* @see fadeTo(String|Number,Number,Function)
|
||||||
*/
|
*/
|
||||||
fadeOut: function(speed, callback){
|
fadeOut: function(speed, callback){
|
||||||
return this.animate({opacity: "hide"}, speed, callback);
|
return this.filter(":visible").animate({opacity: "hide"}, speed, callback).end();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue