jQuery UI provides a useful effect called pulsate
that makes an element pulsate by adjusting its opacity several times. This effect accepts as its options a speed parameter (expressed in milliseconds) and an integer value that specifies how many times the animation should be repeated. Its syntax is as follows:
element.effect('pulsate', options, speed);
options
is an object literal and has as its parameter the times
property that specifies the number of animations to run. An example:
$('#gallery img').each(function() { var $img = $(this); $img.click(function() { $img.effect('pulsate', {times: 3}, 600); }); });
You can see a demo below.