Permalink
Browse files

Normal hide/show toggling was broken, this fixes it (#1219).

  • Loading branch information...
1 parent 5e6c149 commit 8b683b891f2cfd299c1d0708bb41ea26393ea417 @jeresig jeresig committed Jun 21, 2007
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/fx/fx.js
View
10 src/fx/fx.js
@@ -110,9 +110,13 @@ jQuery.fn.extend({
toggle: function( fn, fn2 ){
return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
this._toggle( fn, fn2 ) :
- this.animate({
- height: "toggle", width: "toggle", opacity: "toggle"
- }, fn, fn2);
+ fn ?
+ this.animate({
+ height: "toggle", width: "toggle", opacity: "toggle"
+ }, fn, fn2) :
+ this.each(function(){
+ jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+ });
},
/**

0 comments on commit 8b683b8

Please sign in to comment.