【发布时间】:2013-05-12 08:21:24
【问题描述】:
我正在使用来自示例的动态引导警报。见下文。
如何添加超时功能,以便警报在 X 时间后自动关闭?
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>');
}
【问题讨论】:
标签: javascript jquery twitter-bootstrap timeout