这里是easeOutBounce的方法
easeOutBounce: function (t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
}
我想制作自己的自定义方法,不能使用 jquery 或其他库。
其中 t:时间,b:开始位置,c:位置的总变化,d:持续时间。
任何人都可以解释我如何使用这种方法来获取 easeOutBounce 值吗?我的意思是我将作为参数传递什么以及我将如何使用返回值?
最佳答案
使用 jQuery,您可以简单地在任何动画中调用此事件。确保包含相关的 JS 文件并放置如下内容:
$('#your-div').click(function() {
$(this).animate({height: "100px"}, 500, 'easeOutBounce');
});
关于javascript - 如何使用这个 easeOutBounce 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2949636/