118
rated 0 times
[
121]
[
3]
/ answers: 1 / hits: 26044
/ 11 Years ago, fri, may 17, 2013, 12:00:00
I am using dynamic bootstrap alerts from an example. See below.
How can I add a timeout function so alert closes automatically after X time ?
HTML:
<div id=alert_placeholder></div>
JQUERY:
bootstrap_alert = function() {
}
bootstrap_alert.warning = function(message) {
$('#alert_placeholder').append('<div class=alert alert-block fade in><button type=button class=close data-dismiss=alert>×</button><h4>Info!</h4>'+ message +'</div>');
}
bootstrap_alert.info = function(message) {
$('#alert_placeholder').append('<div class=alert alert-block alert-info fade in><button type=button class=close data-dismiss=alert>×</button><h4>Info!</h4>'+ message +'</div>');
}
More From » jquery