Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

CSS3 Transitions vs. jQuery Animate: Performance

DZone's Guide to

CSS3 Transitions vs. jQuery Animate: Performance

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

Rich Bradshaw has written a detailed tutorial series on CSS Transitions, Transforms, and Animation.

That alone is worth reading; but in case you weren't convinced, Rich also put together a little (and maybe a little unfair) performance comparison:

A head to head comparison of CSS transitions and jQuery's animate. Rather than setting a timer to run repeatedly, transitions are handled natively by the browser. In my rather unscientific testing, transitions are always quicker, running with a higher frame rate, especially with high numbers of elements. They also have the advantage that colours can be animated easily, rather than having to rely on plugins.

 
The results probably won't surprise you, and the conclusion inevitable ('use CSS3 for animation when you can') but Rich's analysis (scroll down), using the Timeline view in the Webkit Inspector, is pretty neat:

 
(Actually, the Timeline is pretty neat, period. I didn't know about it until now..sweet.)

So check out Rich's test and performance discussion, and maybe use Webkit Inspector's Timelinefor performance fine-tuning in the future.

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}