如何将 jQuery 的动画过渡从线性更改为二次
我想我注意到所有 jQuery 转换(例如幻灯片效果)都以线性方式工作。这意味着动画的速度永远不会改变。
我想知道是否可以将其更改为更加二次的行为。这意味着,我希望动画慢慢开始,然后变得更快。
jQuery 有没有办法实现这一点?
I think I noticed that all jQuery transitions (e.g. slide effect) work in a linear way. That means that the speed of the animation never changes.
I wondered if it would be possible to change this to a more quadratic behavior. That means, I want the animation to slowly start and then get faster.
Is there a way in jQuery to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为这是真的,大多数 jQuery 函数都有一个缓动参数(fadeIn/out、slideDown/up)
如果您使用 slideDown (我举了一个例子),您可以指定一个
easing
选项默认为swing
。如果你想要它线性
,你必须指定它取自文档
I don't think that's true, most jQuery function have an easing parameter (fadeIn/out, slideDown/up)
If you use slideDown (i make an example) you can specify an
easing
option which defaults toswing
. If you want itlinear
you must specify itTaken from the docs
几乎所有 jquery 过渡都支持缓动:
此插件中提供了更大的缓动可能性:http ://gsgd.co.uk/sandbox/jquery/easing/
Almost all jquery transitions have support for easing:
A larger set of easing possibilities are available in this plugin: http://gsgd.co.uk/sandbox/jquery/easing/