Commit e057aedd authored by Jörn Zaefferer's avatar Jörn Zaefferer

Fix for #758

parent e50014d4
...@@ -33,16 +33,18 @@ jQuery.fn.extend({ ...@@ -33,16 +33,18 @@ jQuery.fn.extend({
* @see hide(String|Number,Function) * @see hide(String|Number,Function)
*/ */
show: function(speed,callback){ show: function(speed,callback){
return speed ? var hidden = this.filter(":hidden");
this.animate({ speed ?
hidden.animate({
height: "show", width: "show", opacity: "show" height: "show", width: "show", opacity: "show"
}, speed, callback) : }, speed, callback) :
this.each(function(){ hidden.each(function(){
this.style.display = this.oldblock ? this.oldblock : ""; this.style.display = this.oldblock ? this.oldblock : "";
if ( jQuery.css(this,"display") == "none" ) if ( jQuery.css(this,"display") == "none" )
this.style.display = "block"; this.style.display = "block";
}); });
return this;
}, },
/** /**
...@@ -78,17 +80,19 @@ jQuery.fn.extend({ ...@@ -78,17 +80,19 @@ jQuery.fn.extend({
* @see show(String|Number,Function) * @see show(String|Number,Function)
*/ */
hide: function(speed,callback){ hide: function(speed,callback){
return speed ? var visible = this.filter(":visible");
this.animate({ speed ?
visible.animate({
height: "hide", width: "hide", opacity: "hide" height: "hide", width: "hide", opacity: "hide"
}, speed, callback) : }, speed, callback) :
this.each(function(){ visible.each(function(){
this.oldblock = this.oldblock || jQuery.css(this,"display"); this.oldblock = this.oldblock || jQuery.css(this,"display");
if ( this.oldblock == "none" ) if ( this.oldblock == "none" )
this.oldblock = "block"; this.oldblock = "block";
this.style.display = "none"; this.style.display = "none";
}); });
return this;
}, },
// Save the old toggle function // Save the old toggle function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment