How can I modify this jQuery easing function to produce a less exaggerated bounce?

$.easing.easeOutElasticSingleBounce = function (x, t, b, c, d) {
    var s=1.70158;var p=0;var a=c;
    if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
    if (a < Math.abs(c)) { a=c; var s=p/4; }
    else var s = p/(2*Math.PI) * Math.asin (c/a);
    return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};

I'm looking to produce an easing function that emulates this:

http://sandbox.scriptiny.com/tinyslider2/

tinyslider2 uses a similar function that looks something like this:

new Function(this.n+'.slide('+(i==1?t+(12*d):t+(4*d))+','+(i==1?(-1*d):(-1*d))+','+(i==1?2:3)+','+a+')')

But I can't seem to get my head around the math today to fit tinyslider2 equation into the jQuery easing format. If someone can show me an example, I would appreciate it very much.

UPDATE

This equation is very close:

$.easing.custom = function (x, t, b, c, d) {
    var s = 1.70158; 
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}

I just need only the ending bounce without the beginning bounce.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top