Priority to Javascript or Css for animation ? | SoloLearn: Learn to code for FREE!


Priority to Javascript or Css for animation ?

Hello everyone, I just finished css3 courses and it's really a powerful tool to make animations. I used to use plain Javascript for animation though. My question is which way is better in terms of performance ?

5/22/2019 2:34:15 PM

Michaël Randrianarisona

13 Answers

New Answer


Nevermind I found the answer. Css3 rivals with Javascript but not necessarily better. However, Css3 animations run in a separate thread which is an advantage because the browser is single threaded. Say we do something heavy with JS that could freeze the entire page thus stop animations. By using Css3, animations will not freeze.


🤔 Wow, what a strange article. I can see why it was confusing though, since it was pitting JavaScript against JavaScript in its stress test claiming that it was pitting CSS against JavaScript.



Can't you do event driven animations in CSS?


CSS is made for animations, so it is better; but if you want something conditional (like the animation runs when you press a button), you should use JS


Indeed, I don't need any logic. However I'm more confused after looking at this I did the performance test and GSAP (JS) outperformed Zepto (CSS) with a gap of 10 fps.


Css3 is better way to create animation. Also, it is easy to create animation using css. But JavaScript is little difficult. Hope you understand what I am trying to say.


Before css3 you should check out javascript in css3 animation is cool and simple



CSS is Cascade Style Sheet and is made for animations and defining the style, but if you want animation make them with JS or React


--- sometimes must be considered performance such as page speed! In JS, two-part for executing. 1- parse 2- execute but in CSS, Just needed parse for executing. -- CSS Animation it's simple and comfortable -- JS Animation The implement may harder than CSS. Debugging is harder than CSS. JS animation power more than CSS. Remind: 100ms faster -> increase 1% revenue.


Before css3 you should check out javascript


it is fine to use css or javascript, just use the one u got most technique but i think css is easier