/ Published in: JavaScript
For user-friendly animations on hover event.
Prevents repeating animations when hovering object many many times.
Example needs "jquery.color" plugin for color animations. But you can use any animations you want.
Prevents repeating animations when hovering object many many times.
Example needs "jquery.color" plugin for color animations. But you can use any animations you want.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('a.coollink').hover(function(){ $(this).stop().animate({ // magic here, stop THIS object to animate // and do animate from begin backgroundColor: '#21545A', //animate what you want color: '#FFF' }, 500); }, function(){ $(this).stop().animate({ // magic here, stop THIS object to animate // and do animate from begin backgroundColor: '#FFF', //animate what you want color: '#797979' }, 500); });