Commit 8507faea authored by John Resig's avatar John Resig

Fixed an issue with animated .toggle() not working.

parent 79c58b84
...@@ -112,11 +112,12 @@ jQuery.fn.extend({ ...@@ -112,11 +112,12 @@ jQuery.fn.extend({
* @cat Effects * @cat Effects
*/ */
toggle: function( fn, fn2 ){ toggle: function( fn, fn2 ){
return fn ? var args = arguments;
return fn && fn.constructor == Function && fn2 && fn2.constructor == Function ?
this._toggle( fn, fn2 ) : this._toggle( fn, fn2 ) :
this.each(function(){ this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ] jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]
.apply( jQuery(this), arguments ); .apply( jQuery(this), args );
}); });
}, },
......
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