From 8507faea6ed79e46a0461bec9b73879cd700e8ab Mon Sep 17 00:00:00 2001 From: John Resig Date: Sat, 13 Jan 2007 22:38:11 +0000 Subject: [PATCH] Fixed an issue with animated .toggle() not working. --- src/fx/fx.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fx/fx.js b/src/fx/fx.js index d83bf0dd..ece0cea8 100644 --- a/src/fx/fx.js +++ b/src/fx/fx.js @@ -112,11 +112,12 @@ jQuery.fn.extend({ * @cat Effects */ toggle: function( fn, fn2 ){ - return fn ? + var args = arguments; + return fn && fn.constructor == Function && fn2 && fn2.constructor == Function ? this._toggle( fn, fn2 ) : this.each(function(){ jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ] - .apply( jQuery(this), arguments ); + .apply( jQuery(this), args ); }); },