我想我注意到所有 jQuery 转换(例如幻灯片效果)都以线性方式工作。这意味着动画的速度永远不会改变。
我想知道是否可以将其更改为更加二次的行为。这意味着,我希望动画慢慢开始,然后变得更快。
jQuery 有没有办法实现这一点?
最佳答案
我不认为这是真的,大多数 jQuery 函数都有一个缓动参数(fadeIn/out、slideDown/up)
如果您使用slideDown (我举了一个例子)您可以指定一个 easing
选项,默认为 swing
。如果您想要线性
,则必须指定它
.slideDown( [duration] [, easing] [, callback] )
取自文档
Easing
As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.
关于jquery - 如何将 jQuery 的动画过渡从线性更改为二次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9214340/