Skip to content

jQuery plugin to dynamically apply animate.css animations

License

Notifications You must be signed in to change notification settings

danielmahon/animateCSS

Repository files navigation

Animate CSS jQuery Plugin

A jQuery plugin to dynamically apply Dan Eden's animate.css animations with callbacks

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/animatecss.min.js"></script>
<script>
$(document).ready( function(){
  $('#your-id').animateCSS("fadeIn");
});
</script>

Documentation

{
  infinite: false, // True or False
  animationClass: "animate", // Can be any class
  delay: 0 // Can be any value (in ms)
  callback: // Any function
}

When using infinite: true and a delay, the delay will only occur before the first loop

Examples

Basic

$('#your-id').animateCSS('fadeIn');

With callback

$('#your-id').animateCSS('fadeIn', function(){
    alert('Boom! Animation Complete');
});

With delay (in ms)

$('#your-id').animateCSS('fadeIn', {delay: 500});

With delay AND callback

$('#your-id').animateCSS('fadeIn', {
  delay: 1000,
  callback: function(){
    alert('Boom! Animation Complete');
  }
});

If you want to hide an element when the page loads and then apply an effect, it might look something like this:

  .js #your-id {
      visibility:hidden;
  }
$(window).load( function(){
  $('#your-id').animateCSS('fadeIn', function(){
    alert('Boom! Animation Complete');
  });
});

Release History

1.1.0

  • Rewrite in CoffeeScript
  • Allow custom .animated class
  • Allow for .infinite animation
  • Add grunt for consistent build output
  • Add Bower support

About

jQuery plugin to dynamically apply animate.css animations

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.3%
  • CoffeeScript 29.7%