Javascript 在x秒后关闭Twitter引导盒

Javascript 在x秒后关闭Twitter引导盒,javascript,jquery,twitter-bootstrap,bootbox,Javascript,Jquery,Twitter Bootstrap,Bootbox,有可能在10秒后关闭twitter引导程序吗?!我这样打开它: bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) { if (result) { } }); 此代码将在10秒后自动关闭打开的引导框 window.setTimeout(function(){ bootbox.hideAll(); }, 10000); // 10 seconds expressed in milli

有可能在10秒后关闭twitter引导程序吗?!我这样打开它:

bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) {
    if (result) {

    }
}); 

此代码将在10秒后自动关闭打开的引导框

window.setTimeout(function(){
    bootbox.hideAll();
}, 10000); // 10 seconds expressed in milliseconds

请参阅

我刚刚提交了一个补丁,将此功能添加到bootbox

可以在下面的链接上找到它

将此修补程序添加到bootbox.js后,可以在bootbox的选项中设置额外的超时选项

bootbox.dialog({
    message  : "Your operation completed successfully.",
    timeOut : 2000
});

干杯。

哇,真是太棒了!另一个问题,我能显示开机盒中剩余的秒数吗@克里斯通很高兴这有帮助。你需要把它作为另一个问题发布,它稍微有点复杂。如果这已经回答了原来的问题,不要忘记选择它作为答案。谢谢