Animation
Jquery.extend ({
Easing:
{//******* back
Backeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
var s = 1.70158; Default overshoot value, can is adjusted to suit
Return c * (P/= 1) * p * ((s + 1) * p-s) + firstnum;
},
Backeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
var s = 1.70158; Default overshoot value, can is adjusted to suit
Return c * (p = p/1-1) * p * ((s + 1) * p + s) + 1) + Firstnum;
},
Backeaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
var s = 1.70158; Default overshoot value, can is adjusted to suit
if ((P/= 0.5) < 1)
Return C/2 * (P * p * ((S *= (1.525) + 1) * p-s)) + Firstnum;
Else
Return C/2 * (P-= 2) * p * (((s *= (1.525)) + 1) * p + s) + 2) + Firstnum;
},
Bounce
Bounceeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
var inv = This.bounceeaseout (1-p, 1, 0, diff);
return C-INV + firstnum;
},
Bounceeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if (P < (1/2.75)) {
Return c * (7.5625 * p * p) + Firstnum;
}
else if (P < (2/2.75)) {
Return c * (7.5625 * (P-= (1.5/2.75)) * p +.) + Firstnum;
}
else if (P < (2.5/2.75)) {
Return c * (7.5625 * (P-= (2.25/2.75)) * p +. 9375) + Firstnum;
}
else {
Return c * (7.5625 * (P-= (2.625/2.75)) * p +. 984375) + Firstnum;
}
},
Circ
Circeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return-c * (MATH.SQRT (1-(P/= 1) * p)-1) + Firstnum;
},
Circeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * MATH.SQRT (1-(P = p/1-1) * p) + Firstnum;
},
Circeaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if ((P/= 0.5) < 1)
RETURN-C/2 * (MATH.SQRT (1-P * p)-1) + Firstnum;
Else
Return C/2 * (MATH.SQRT (1-(P-= 2) * p) + 1) + Firstnum;
},
Cubic
Cubiceasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (P/= 1) * p * p + firstnum;
},
Cubiceaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (p = p/1-1) * p * p + 1) + Firstnum;
},
Cubiceaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if ((P/= 0.5) < 1)
Return C/2 * p * p * p + firstnum;
Else
Return C/2 * (P-= 2) * p * p + 2) + Firstnum;
},
Elastic
Elasticeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if (p = = 0) return firstnum;
if (p = = 1) return C;
var peroid = 0.25;
var s;
var amplitude = c;
if (Amplitude < Math.Abs (c)) {
amplitude = C;
s = PEROID/4;
}
else {
s = peroid/(2 * math.pi) * Math.asin (C/amplitude);
}
Return-(Amplitude * MATH.POW (2, * (P-= 1)) * Math.sin ((p * 1-s) * (2 * math.pi)/peroid)) + Firstnum;
},
Elasticeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if (p = = 0) return firstnum;
if (p = = 1) return C;
var peroid = 0.25;
var s;
var amplitude = c;
if (Amplitude < Math.Abs (c)) {
amplitude = C;
s = PEROID/4;
}
else {
s = peroid/(2 * math.pi) * Math.asin (C/amplitude);
}
Return-(Amplitude * MATH.POW (2, -10 * p) * Math.sin ((p * 1-s) * (2 * math.pi)/peroid)) + C;
},
Expo
Expoeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
return (P = = 0)? FIRSTNUM:C * MATH.POW (2, * (p-1)) + firstnum-c * 0.001;
},
Expoeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
return (P = = 1)? C:diff * 1.001 * (-math.pow (2, -10 * p) + 1) + Firstnum;
},
Expoeaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if (p = = 0) return firstnum;
if (p = = 1) return C;
if ((P/= 0.5) < 1)
Return C/2 * MATH.POW (2, * (p-1)) + firstnum-c * 0.0005;
Else
return C/2 * 1.0005 * (-math.pow (2, -10 *--p) + 2) + Firstnum;
},
Quad
Quadeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (P/= 1) * p + firstnum;
},
Quadeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return-c * (P/= 1) * (p-2) + firstnum;
},
Quadeaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if ((P/= 0.5) < 1)
Return C/2 * p * p + firstnum;
Else
RETURN-C/2 * ((--p) * (p-2)-1) + Firstnum;
},
Quart
Quarteasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (P/= 1) * p * p * p + firstnum;
},
Quarteaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return-c * (p = p/1-1) * p * p * p-1) + firstnum;
},
Quarteaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if ((P/= 0.5) < 1)
Return C/2 * p * p * p * p + firstnum;
Else
RETURN-C/2 * (P-= 2) * p * p * p-2) + firstnum;
},
Quint
Quinteasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (P/= 1) * p * p * p * PS + firstnum;
},
Quinteaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * (p = p/1-1) * p * p * p * p + 1) + Firstnum;
},
Quinteaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
if ((P/= 0.5) < 1)
Return C/2 * p * p * p * p * p + firstnum;
Else
Return C/2 * (P-= 2) * p * p * p * + 2) + Firstnum;
},
Sine
Sineeasein:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return-c * MATH.COS (P * (MATH.PI/2)) + C + firstnum;
},
Sineeaseout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
Return c * Math.sin (P * (MATH.PI/2)) + Firstnum;
},
Sineeaseinout:function (P, N, Firstnum, diff) {
var c = Firstnum + diff;
RETURN-C/2 * (Math.Cos (MATH.PI * p)-1) + Firstnum;
}
}
});