Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 8b683b891f2cfd299c1d0708bb41ea26393ea417 1 parent 5e6c149
John Resig jeresig authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/fx/fx.js
10 src/fx/fx.js
View
@@ -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" ]();
+ });
},
/**
Please sign in to comment.
Something went wrong with that request. Please try again.