Skip to content
Permalink
Browse files

finally added the toggle option for animate(). It's not beautiful rig…

…ht now, but it works for the time.
  • Loading branch information
Paul Bakaus
Paul Bakaus committed Dec 8, 2006
1 parent f1c91fd commit 12d13d9adaea1139b0928180c17aa83eef5d5c6a
Showing with 24 additions and 0 deletions.
  1. +24 −0 src/fx/fx.js
@@ -484,6 +484,30 @@ jQuery.extend({
// Begin the animation
z.custom(z.el.orig[prop], 0);
};

//Simple 'toggle' function
z.toggle = function() {
if ( !z.el.orig ) z.el.orig = {};

// Remember where we started, so that we can go back to it later
z.el.orig[prop] = this.cur();

if(oldDisplay == 'none') {
z.o.show = true;

// Stupid IE, look what you made me do
if ( prop != "opacity" )
y[prop] = "1px";

// Begin the animation
z.custom(0, z.el.orig[prop]);
} else {
z.o.hide = true;

// Begin the animation
z.custom(z.el.orig[prop], 0);
}
};

// Each step of an animation
z.step = function(firstNum, lastNum){

0 comments on commit 12d13d9

Please sign in to comment.
You can’t perform that action at this time.