How to Add CSS Animation to a Website Easily with Animate.css

With every growing new day web is evolving, people are coming out with lots of new ideas and stuff to attract billions of internet savvy people. Web 2.0, HTML 5 etc, all these things concepts have enhanced the user experience drastically. Many frontend web developers tend to add lots of dynamic content to their design to keep use interested. They have tons of JavaScript libraries available at their disposal to add dynamic content or to add css animation to a website.

In this article we will see one such library Animate.css that is purely based on css and supports tons of animation and transition effects. This library is created and maintained by Daniel Eden.

First things First – Get a Copy

You need to download the animation.css from its official site. You can grab a copy from here or you can check it on Github. The css file is only 56kb and its minified version is 40kb. So you are getting bunch of cool, fun, and cross-browser animations for you to use in your projects with minimal foot print.

What are the animations supported

As mentioned above you have tons of css animation that can be used for your project. The animations are categorized as below so you can choose the right one

  • Attention Seekers – bounce, flash, flash etc
  • Bouncing Entrances – bounceIn, bounceInDown etc
  • Bouncing Exits – bounceOut, bounceOutUp etc
  • Fading Entrances – fadeIn, fadeInDownBig etc
  • Fading Exits – fadeOutDownBig, fadeOutLeftBig etc
  • Flippers – flip, flipOutX etc
  • Rotating Entrances – rotateInDownLeft, rotateInUpLeft etc
  • Rotating Exits – rotateOutDownLeft, rotateOutUpRight etc
  • Sliders – slideInLeft, slideOutUp etc
  • Specials – hinge, rollOut etc

 Usage

The library provides you one of the easiest way to add animation. You only need to include the animation.css and apply some animation class to any element you want to add animation to and you are done. When page loads you will get perfect animation.

Add css to your html as shown below

Then simply add the css class to element

Now go and refresh your page, you have your animation added to your page. We have setup a demo of complete animations available from this library, which you can see here

The demo uses JQuery code to apply different css on each button click. On each click the Js code will retrive data-anim attrib and apply that animation to our element. You can see here how we can apply css class

HTML

JQuery

Live Demo

2 Comments
  1. July 11, 2014 | Reply
  2. February 18, 2014 | Reply

Leave a Reply to Sito Cancel reply

Your email address will not be published. Required fields are marked *