什么更快? CSS3转换或jQuery动画? [英] what's faster? CSS3 transitions or jQuery animations?

查看:152
本文介绍了什么更快? CSS3转换或jQuery动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iPad HTML5应用程序,我已经实现了ontouch支持更快地触发事件,我使用jQuery来更容易地定位元素,但对于我使用CSS3过渡的动画



你认为更快?使用jQuery动画,因为我已经导入了库或使用CSS3过渡时,用jQuery定位元素?

解决方案

根据< =http://css3.bradshawenterprises.com/blog/jquery-vs-css3-transitions/> 此链接 ,jQuery动画比css动画慢得多。



原因可能是因为jquery必须使用计时器和循环来修改DOM元素的道具。 CSS是浏览器引擎的一部分。这在很大程度上取决于系统的硬件。您还可以在Chrome或Firefox的分析中检查。


I'm working on an iPad HTML5 app and I've already implemented ontouch support to trigger events faster and I'm using jQuery to target the elements easier, but for the animations I'm using CSS3 transitions

What do you think is faster? using jQuery animations since I already have imported the library or use CSS3 transitions when targeting elements with jQuery?

解决方案

According to this link, jQuery animation is much slower then css animation.

Reason can be because jquery has to modify the props of the DOM element using timers and a loop. The CSS is part of the browser engine . which depends pretty much on hardware of system. You can also check that in profiling of Chrome or Firefox.

这篇关于什么更快? CSS3转换或jQuery动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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