Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color flash in Jquery?

Tags:

jquery

I am working on a JQuery, which hides & shows a particular element whenever user checks a box. I want to do a color flash on the element which is changed from hidden to visible, so that user knows where it is.

I tried doing this

jQuery("#login-form").show()
                     .css({backgroundColor: "red"})
                     .delay(2000)
                     .queue(function() {
                         jQuery("#login-form").css({backgroundColor: "#FFFFFF"});
                     });

but it works for the first time only, after then it just stops. Any ideas?

like image 300
Nitesh Avatar asked Nov 26 '25 10:11

Nitesh


1 Answers

You might check out the ui/effect pulsate: http://docs.jquery.com/UI/Effects/Pulsate

$(#login-form).effect("pulsate", { times:3 }, 2000);

This does require you to download the ui lib configured to include pulsate.

like image 100
scrappedcola Avatar answered Nov 29 '25 00:11

scrappedcola



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!