I'm trying to make my white background flash green. Currently I have this code which turns it green:
$( "#modal_newmessage" ).animate({
backgroundColor: "#8bed7e"
}, 500 );
However, I can't figure how to make it turn white again in the same animation. How do I do this?
You can chain another .animate() call since the animations will be queued in the fx queue.
$("#modal_newmessage").animate({
backgroundColor: "#8bed7e"
}, 500).animate({
backgroundColor: "#fff"
}, 500);
Remember most jQuery functions are chainable without need to call $("#modal_newmessage") twice.
See it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With