使用CSS动画超过jQuery动画有什么优势吗? (性能,或其他) [英] Is there any advantage to using CSS animations over jQuery animations? (performance, or otherwise)

查看:119
本文介绍了使用CSS动画超过jQuery动画有什么优势吗? (性能,或其他)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是,
CSS动画很酷,但CSS3遵从是令人讨厌的不标准。
,但是,忽略所有的浏览器问题,以及他们无法更新最新的W3C,

I mean, CSS animations are cool, but CSS3 compliance is annoyingly un-standard. but, ignoring all the issues with browsers and their inability to be up-to-date with the latest W3C,

是否有某种性能优势jQuery动画?

Is there some sort of performance advantage over jQuery animations?

为什么要实现它们?

推荐答案

一般的经验法则,每当避免JavaScript 可以并且达到相同的结果,应该避免。

As a general rule of thumb, whenever JavaScript can be avoided and the same result achieved, it should be avoided.


  • jQuery动画不是真正的动画,它们是伪造的,而本地CSS3浏览器动画实际上是动画。因此,原生CSS3动画可以由GPU加速,而jQuery动画不能。

  • 请注意,并非所有浏览器都支持CSS3动画/转换。您可能希望测试浏览器是否支持,并据此采取行动。

  • jQuery animations are not real animations, they are faked, while the native CSS3 browser animations are in fact, animations. As a result native CSS3 animations can be accelerated by the GPU, whereas jQuery animations cannot.
  • Do note that not all browsers support CSS3 animations/transitions. You would probably want to test if the browser supports it, and act accordingly.

这篇关于使用CSS动画超过jQuery动画有什么优势吗? (性能,或其他)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆