Search code examples
javascriptcssanimationparallaxpreloader

What language allows more flexibility when it comes to animation CSS3 or js?


I am trying to create a few small animation sequences using JUST CSS3 or js, I do not wish to use both together. All I want to know from this is which one has more flexibility.

By flexibility I mean which one has more options for animation. I will be creating a webpage that has several parallax objects and the clients also wants a lot of animations on the page "fade in text", "slide in text", "bouncing error messages"

Which option is the best for the situation described above?


Solution

  • While I've always found animating with CSS a bit tedious, there's not that much you can do with vanilla javascript either.

    If you expect to be handling a lot of animations, the best way would be to pick a javascript animation library to do the heavy lifting for you.

    In your case I can recommend GSAP (https://greensock.com/) which comes with LOADS of features out of the box and is free to use in most cases (but still - do read the license before using it in a commercial project).

    For an open-source alternative you can take a look at Velocity (http://julian.com/research/velocity/).

    And finally, there's always jQuery for simple animations, but it often comes with performance problems, especially on mobile devices.