×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Srinivasan Pusuluri
Added: Jun 17, 2014 10:38 AM
Views: 27
  1. function animationClick(element, animation){
  2.   element = $(element);
  3.   element.click(
  4.     function() {
  5.       element.addClass('animated ' + animation);
  6.       //wait for animation to finish before removing classes
  7.       window.setTimeout( function(){
  8.           element.removeClass('animated ' + animation);
  9.       }, 2000);
  10.     }
  11.   );
  12. };