X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffx%2Ffx.js;h=f53b2b29e5ed243c53f64af41c8b5e97c419316c;hb=8b683b891f2cfd299c1d0708bb41ea26393ea417;hp=51e81571819e7cd36c5dfcb475fd104001866de6;hpb=5e6c14993a1010a2f6e8ce1f1d5d64171d324581;p=jquery.git diff --git a/src/fx/fx.js b/src/fx/fx.js index 51e8157..f53b2b2 100644 --- a/src/fx/fx.js +++ b/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" ](); + }); }, /**