JQuery ripple effect

Hoping someone can give me some pointers. I am trying to add a ripple effect to a div after clicking a button.

The following script that I wrote is good and works, but I would ideally want it to alternate between the background colors and not div completely disappear.

Am I using the wrong effect? Or is there a way to combine momentum and backlight, perhaps?

$(document).ready(function() { $("li#emailSellerLink a").click(function(){ $("#contactColumn").effect( "pulsate", {times:3}, 5000 ); }); }); 

thanks

+7
source share
1 answer

You can use the .animate() function - http://jsfiddle.net/Fe8Jy/

 $("a").click(function(e) { e.preventDefault(); for (var i = 0; i < 3; i++ ) { $("#contactColumn") .animate( { backgroundColor: "#f00" }, 2000 ) .animate( { backgroundColor: "transparent" }, 2000 ); } }); 
+15
source

All Articles