* left: 50, opacity: 'show'
* }, 500);
*
- * @test stop();
- * var hash = {opacity: 'show'};
- * var hashCopy = $.extend({}, hash);
- * $('#foo').animate(hash, 'fast', function() {
- * ok( hash.opacity == hashCopy.opacity, 'Check if animate changed the hash parameter' );
- * start();
- * });
- *
* @name animate
* @type jQuery
* @param Hash params A set of style attributes that you wish to animate, and to what end.
// 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]); \r
+ } else {
+ z.o.hide = true;
+
+ // Begin the animation
+ z.custom(z.el.orig[prop], 0);\r
+ } \r
+ };
// Each step of an animation
z.step = function(firstNum, lastNum){