×

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:37 AM
Views: 20
Tags: css animate hover
  1. function animationHover(element, animation){
  2.   element = $(element);
  3.   element.hover(
  4.     function() {
  5.       element.addClass('animated ' + animation);
  6.     },
  7.     function(){
  8.       //wait for animation to finish before removing classes
  9.       window.setTimeout( function(){
  10.         element.removeClass('animated ' + animation);
  11.       }, 2000);
  12.     }
  13.   );
  14. };