Search code examples
javascriptcssmobile-safari

Are css animations still faster than javascript animations in ios 6+?


To animate an element, we can use css animations, or we can do it in javascript.

Reading up on this, it seems like css animations are expected to render more quickly than javascript animations, since the browser can execute css animations in native code. This info was gathered from posts dated from 2008 - 2011.

With ios 6, is this still the case? In the release notes, I found this item:

"WebKit no longer always creates hardware-accelerated layers 
for elements with the -webkit-transform: preserve-3d option. 
Authors should stop using this option as a way to get hardware 
acceleration."

http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html

Since I'm pretty new to animations in the web, I'm not sure what the current status is,

Thanks


Solution

  • CSS animations and transitions will always be faster than JavaScript ones, simply because there is just a single instruction to be handled, as opposed to having to follow all the JS instructions required for the same effect.