I would like to flash a success message on my page.
I am using the jQuery fadeOut method to fade and then remove the element. I can increase the duratio
fadeOut
var $msg = $('#msg-container-id'); $msg.fadeIn(function(){ setTimeout(function(){ $msg.fadeOut(function(){ $msg.remove(); }); },5000); });
For a pure jQuery approach, you can do
$("#element").animate({opacity: 1.0}, 5000).fadeOut();
It's a hack, but it does the job