javascript - jQuery 缓动函数中有哪些不同的参数

标签 javascript jquery animation

我在 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 - 50px
  • c - 100px
  • d - 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/

相关文章:

javascript - 国家代码后面的0怎么去掉

javascript - CodeIgniter 和 JConfirmAction

jquery - CSS 动画启动时不稳定

html - CSS 中的相对 Spritesheet 动画

javascript - 如何使用node.js的fs.write函数?

javascript - node.js 全局配置

Javascript/CSS-如何在没有第三方 JS 库的情况下更改文本区域滚动条的颜色?

jquery - 使用 JQuery 替换切换 anchor 中的文本

javascript - 如何跟踪 Mixpanel 中 youtube 嵌入式视频的播放按钮点击?

javascript - Velocity.js 动画延迟