hh54188
hh54188

Reputation: 15656

For website animation effects, which has better execution performance: CSS3 or jQuery?

Which has better execution performance: CSS3 animations, or jQuery animations?

How do they affect the user's browser’s performance or execution speed?

I’m not concerned about browser compatibility, just execution performance.

Upvotes: 4

Views: 316

Answers (2)

Ky -
Ky -

Reputation: 32163

In my experience, the tradeoff is compatibility. If you absolutely need your webpage to have the animations, go with jQuery for compatibility with older browsers. However, CSS3 gives the browser an expected animation that can be precalculated and rendered in the GPU. This means that CSS3 has a distinct performance advantage over jQuery in all cases. Of course, CSS3 animations will have varying performance between browsers and machines, but the performance of JavaScript tends to vary along with it, meaning that if CSS3 is slow, JS will be even slower.

Upvotes: 0

Igor Escobar
Igor Escobar

Reputation: 1087

@tstenner shared a good link and it probably would kill your doubts but if you want make some tests you can make some performance tests using the http://jsperf.com/

And you should check out the "Animate.css" on Github. Great and cool animations with only CSS3 http://daneden.me/animate/

[]'s Igor.

Upvotes: 2

Related Questions