什么更快?CSS3 过渡还是 jQuery 动画? [英] what's faster? CSS3 transitions or jQuery animations?

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

问题描述

我正在开发一个 iPad HTML5 应用程序,我已经实现了 ontouch 支持以更快地触发事件,我正在使用 jQuery 来更轻松地定位元素,但是对于动画我使用的是 CSS3 转换

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

你认为什么更快?使用 jQuery 动画,因为我已经导入了库或在使用 jQuery 定位元素时使用 CSS3 转换?

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?

推荐答案

根据 this链接,jQuery 动画比 css 动画慢得多.

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

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

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天全站免登陆