When I first saw the alerts in Bootstrap I thought they would behave like the modal window does, dropping down or fading in, and then fading out when closed. But it seems li
This is very important question and I was struggling to get it done (show/hide) message by replacing current and add new message.
Below is working example:
function showAndDismissAlert(type, message) {
var htmlAlert = '' + message + '';
$(".alert-messages").prepend(htmlAlert);
$(".alert-messages .alert").hide().fadeIn(600).delay(2000).fadeOut(1000, function() {
$(this).remove();
});
}
Hope it will help others!