Heart Beat Plugin
This plugin is useful if you want to make an item disappear and reappear using a delay. In fact, it fade in and out depending on your settings.
Example #1 of doing a beat each 2 seconds (2000 milliseconds):
I’m beating!
1 2 3 4 5 6 7 | $(document).ready(function(){ $("#beat").heartBeat( { delayBetweenAnimation:2000, // Delay in ms between fade in and fade out. delay:1000 // Time it take to do the fading animation. }); }); |
Example #2 of doing a little animation with 3 divs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | $(document).ready(function(){ $("#beat1").heartBeat( { delayBetweenAnimation:2000, delay:1000 }); setTimeout(function(){ $("#beat2").heartBeat( { delayBetweenAnimation:2000, delay:1000 }); }, 200); setTimeout(function(){ $("#beat3").heartBeat( { delayBetweenAnimation:2000, delay:1000 }); }, 500); }); |