eads@18: /* eads@18: * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ eads@18: * eads@18: * Uses the built in easing capabilities added In jQuery 1.1 eads@18: * to offer multiple easing options eads@18: * eads@18: * TERMS OF USE - jQuery Easing eads@18: * eads@18: * Open source under the BSD License. eads@18: * eads@18: * Copyright © 2008 George McGinley Smith eads@18: * All rights reserved. eads@18: * eads@18: * Redistribution and use in source and binary forms, with or without modification, eads@18: * are permitted provided that the following conditions are met: eads@18: * eads@18: * Redistributions of source code must retain the above copyright notice, this list of eads@18: * conditions and the following disclaimer. eads@18: * Redistributions in binary form must reproduce the above copyright notice, this list eads@18: * of conditions and the following disclaimer in the documentation and/or other materials eads@18: * provided with the distribution. eads@18: * eads@18: * Neither the name of the author nor the names of contributors may be used to endorse eads@18: * or promote products derived from this software without specific prior written permission. eads@18: * eads@18: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY eads@18: * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF eads@18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE eads@18: * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, eads@18: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE eads@18: * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED eads@18: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING eads@18: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED eads@18: * OF THE POSSIBILITY OF SUCH DAMAGE. eads@18: * eads@18: */ eads@18: eads@18: // t: current time, b: begInnIng value, c: change In value, d: duration eads@18: jQuery.easing['jswing'] = jQuery.easing['swing']; eads@18: eads@18: jQuery.extend( jQuery.easing, eads@18: { eads@18: def: 'easeOutQuad', eads@18: swing: function (x, t, b, c, d) { eads@18: //alert(jQuery.easing.default); eads@18: return jQuery.easing[jQuery.easing.def](x, t, b, c, d); eads@18: }, eads@18: easeInQuad: function (x, t, b, c, d) { eads@18: return c*(t/=d)*t + b; eads@18: }, eads@18: easeOutQuad: function (x, t, b, c, d) { eads@18: return -c *(t/=d)*(t-2) + b; eads@18: }, eads@18: easeInOutQuad: function (x, t, b, c, d) { eads@18: if ((t/=d/2) < 1) return c/2*t*t + b; eads@18: return -c/2 * ((--t)*(t-2) - 1) + b; eads@18: }, eads@18: easeInCubic: function (x, t, b, c, d) { eads@18: return c*(t/=d)*t*t + b; eads@18: }, eads@18: easeOutCubic: function (x, t, b, c, d) { eads@18: return c*((t=t/d-1)*t*t + 1) + b; eads@18: }, eads@18: easeInOutCubic: function (x, t, b, c, d) { eads@18: if ((t/=d/2) < 1) return c/2*t*t*t + b; eads@18: return c/2*((t-=2)*t*t + 2) + b; eads@18: }, eads@18: easeInQuart: function (x, t, b, c, d) { eads@18: return c*(t/=d)*t*t*t + b; eads@18: }, eads@18: easeOutQuart: function (x, t, b, c, d) { eads@18: return -c * ((t=t/d-1)*t*t*t - 1) + b; eads@18: }, eads@18: easeInOutQuart: function (x, t, b, c, d) { eads@18: if ((t/=d/2) < 1) return c/2*t*t*t*t + b; eads@18: return -c/2 * ((t-=2)*t*t*t - 2) + b; eads@18: }, eads@18: easeInQuint: function (x, t, b, c, d) { eads@18: return c*(t/=d)*t*t*t*t + b; eads@18: }, eads@18: easeOutQuint: function (x, t, b, c, d) { eads@18: return c*((t=t/d-1)*t*t*t*t + 1) + b; eads@18: }, eads@18: easeInOutQuint: function (x, t, b, c, d) { eads@18: if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; eads@18: return c/2*((t-=2)*t*t*t*t + 2) + b; eads@18: }, eads@18: easeInSine: function (x, t, b, c, d) { eads@18: return -c * Math.cos(t/d * (Math.PI/2)) + c + b; eads@18: }, eads@18: easeOutSine: function (x, t, b, c, d) { eads@18: return c * Math.sin(t/d * (Math.PI/2)) + b; eads@18: }, eads@18: easeInOutSine: function (x, t, b, c, d) { eads@18: return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; eads@18: }, eads@18: easeInExpo: function (x, t, b, c, d) { eads@18: return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; eads@18: }, eads@18: easeOutExpo: function (x, t, b, c, d) { eads@18: return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; eads@18: }, eads@18: easeInOutExpo: function (x, t, b, c, d) { eads@18: if (t==0) return b; eads@18: if (t==d) return b+c; eads@18: if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; eads@18: return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; eads@18: }, eads@18: easeInCirc: function (x, t, b, c, d) { eads@18: return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; eads@18: }, eads@18: easeOutCirc: function (x, t, b, c, d) { eads@18: return c * Math.sqrt(1 - (t=t/d-1)*t) + b; eads@18: }, eads@18: easeInOutCirc: function (x, t, b, c, d) { eads@18: if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; eads@18: return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; eads@18: }, eads@18: easeInElastic: function (x, t, b, c, d) { eads@18: var s=1.70158;var p=0;var a=c; eads@18: if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; eads@18: if (a < Math.abs(c)) { a=c; var s=p/4; } eads@18: else var s = p/(2*Math.PI) * Math.asin (c/a); eads@18: return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; eads@18: }, eads@18: easeOutElastic: function (x, t, b, c, d) { eads@18: var s=1.70158;var p=0;var a=c; eads@18: if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; eads@18: if (a < Math.abs(c)) { a=c; var s=p/4; } eads@18: else var s = p/(2*Math.PI) * Math.asin (c/a); eads@18: return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; eads@18: }, eads@18: easeInOutElastic: function (x, t, b, c, d) { eads@18: var s=1.70158;var p=0;var a=c; eads@18: if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); eads@18: if (a < Math.abs(c)) { a=c; var s=p/4; } eads@18: else var s = p/(2*Math.PI) * Math.asin (c/a); eads@18: if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; eads@18: return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; eads@18: }, eads@18: easeInBack: function (x, t, b, c, d, s) { eads@18: if (s == undefined) s = 1.70158; eads@18: return c*(t/=d)*t*((s+1)*t - s) + b; eads@18: }, eads@18: easeOutBack: function (x, t, b, c, d, s) { eads@18: if (s == undefined) s = 1.70158; eads@18: return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; eads@18: }, eads@18: easeInOutBack: function (x, t, b, c, d, s) { eads@18: if (s == undefined) s = 1.70158; eads@18: if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; eads@18: return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; eads@18: }, eads@18: easeInBounce: function (x, t, b, c, d) { eads@18: return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; eads@18: }, eads@18: easeOutBounce: function (x, t, b, c, d) { eads@18: if ((t/=d) < (1/2.75)) { eads@18: return c*(7.5625*t*t) + b; eads@18: } else if (t < (2/2.75)) { eads@18: return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; eads@18: } else if (t < (2.5/2.75)) { eads@18: return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; eads@18: } else { eads@18: return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; eads@18: } eads@18: }, eads@18: easeInOutBounce: function (x, t, b, c, d) { eads@18: if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; eads@18: return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; eads@18: } eads@18: }); eads@18: eads@18: /* eads@18: * eads@18: * TERMS OF USE - EASING EQUATIONS eads@18: * eads@18: * Open source under the BSD License. eads@18: * eads@18: * Copyright © 2001 Robert Penner eads@18: * All rights reserved. eads@18: * eads@18: * Redistribution and use in source and binary forms, with or without modification, eads@18: * are permitted provided that the following conditions are met: eads@18: * eads@18: * Redistributions of source code must retain the above copyright notice, this list of eads@18: * conditions and the following disclaimer. eads@18: * Redistributions in binary form must reproduce the above copyright notice, this list eads@18: * of conditions and the following disclaimer in the documentation and/or other materials eads@18: * provided with the distribution. eads@18: * eads@18: * Neither the name of the author nor the names of contributors may be used to endorse eads@18: * or promote products derived from this software without specific prior written permission. eads@18: * eads@18: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY eads@18: * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF eads@18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE eads@18: * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, eads@18: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE eads@18: * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED eads@18: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING eads@18: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED eads@18: * OF THE POSSIBILITY OF SUCH DAMAGE. eads@18: * eads@18: */