在 Twitter Bootbox 中,是否可以在 10 秒后关闭对话框?我是这样打开它的:
bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) {
if (result) {
}
});
在 Twitter Bootbox 中,是否可以在 10 秒后关闭对话框?我是这样打开它的:
bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) {
if (result) {
}
});
这段代码将在10秒钟后自动关闭打开的bootbox。
window.setTimeout(function(){
bootbox.hideAll();
}, 10000); // 10 seconds expressed in milliseconds
点击这里查看文档。
https://github.com/bhagyas/bootbox/commit/72cd1ada43d3aa74f0dcfb10d66219fe208063af
在将此补丁添加到bootbox.js后,您可以在选项中设置一个额外的timeOut选项。bootbox.dialog({
message : "Your operation completed successfully.",
timeOut : 2000
});
干杯。