我在 https://github.com/danro/jquery-easing/blob/master/jquery.easing.js 看到 jQuery 的缓动函数.
我看到每个函数都有 5 个参数,但我无法弄清楚它们是什么以及它们如何与 animate
的调用联系起来。
x
- ??????t
- 当前时间 -new Date()
???b
- 起始值c
- 值变化???d
- 持续时间
例如,我会调用如下函数:
$("div").width(50).animate({
width: 150px
}, 2000);
这个调用会像这样匹配吗:
x
- ??????t
- 每次调用更新的当前时间b
- 50pxc
- 100pxd
- 2000
最佳答案
x is an extra parameter not needed for the equations, but necessary for compatibility with jQuery
引用:link
因此,x
等于 null
,并且 t
以自动画开始以来的毫秒数表示
我认为你对其他人也有权利。
您可以看到this post为了更好的理解
关于javascript - jQuery 缓动函数中有哪些不同的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31271003/