mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
finally added the toggle option for animate(). It's not beautiful right now, but it works for the time.
This commit is contained in:
parent
f1c91fd023
commit
12d13d9ada
24
src/fx/fx.js
24
src/fx/fx.js
@ -485,6 +485,30 @@ jQuery.extend({
|
|||||||
z.custom(z.el.orig[prop], 0);
|
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
|
// Each step of an animation
|
||||||
z.step = function(firstNum, lastNum){
|
z.step = function(firstNum, lastNum){
|
||||||
var t = (new Date()).getTime();
|
var t = (new Date()).getTime();
|
||||||
|
Loading…
Reference in New Issue
Block a user