javascript jQuery 动画对比 GreenSock TweenMax

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13902961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 20:06:48  来源:igfitidea点击:

jQuery Animation vs GreenSock TweenMax

javascriptjquerytweenmax

提问by GomatoX

I encounter with a question what the cons and pros of using jquery.animate()and GreenSockTweenMaxanimating engines. So maybe there is any one who knows it. There is not enough information on the web, also what about the performance.

我有一个问题,遇到什么利弊和使用的优点jquery.animate()使用GreenSock TweenMax动画引擎。所以也许有人知道它。网络上没有足够的信息,性能如何。

I tried to use both, jquery.animate()and tweenMax, but in some cases i prefer to use jQueryengine, in other GreenSock.

我尝试同时使用jquery.animate()tweenMax,但在某些情况下,我更喜欢在其他GreenSock 中使用jQuery引擎。

I'm trying to decide which is better, and not to jump from one to other.

我试图决定哪个更好,而不是从一个跳到另一个。

Thanks in future, it's realy interesting to know which to use.

感谢将来,知道使用哪个真的很有趣。

Engines:

引擎:

http://jquery.com

http://jquery.com

https://www.greensock.com/gsap-js/

https://www.greensock.com/gsap-js/

回答by Gurpreet Singh

jQuery's fadeIn() and fadeOut() methods are quite convenient. However, if you are going for something more expressive, I would suggest you to use GSAP (GreenSock Animation Platform). jQuery animations are generally bit slow and TweenLite is significantly faster (20 times) than jQuery animation according to GreenSock.

jQuery 的fadeIn() 和fadeOut() 方法非常方便。但是,如果您想要更具表现力的东西,我建议您使用GSAP (GreenSock Animation Platform)。根据 GreenSock 的说法,jQuery 动画通常有点慢,TweenLite 比 jQuery 动画快得多(20 倍)。

In addition you will be getting really handy functions for animations such as reverse, bezier curve, timeshift, pause & skew etc and better hardware acceleration support on mobile devices.

此外,您将获得非常方便的动画功能,例如反向、贝塞尔曲线、时移、暂停和倾斜等,以及更好的移动设备硬件加速支持。

Personally, I think GSAP is better but a tiny handy selector engine would have been cool.

就个人而言,我认为 GSAP 更好,但一个小巧方便的选择器引擎会很酷。

Here is very good comparison between two.

这是两者之间非常好的比较。

UPDATE

更新

HTML5 Animation Speed Test

HTML5 动画速度测试