Is it possible to close a twitter bootbox after 10 seconds?! i open it like this:

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

    }
}); 
有帮助吗?

解决方案

This code will close the open bootbox automatically after 10 seconds.

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

See the documentation here

其他提示

I just committed a patch that would add this functionality to bootbox.

It is available on the link below.

https://github.com/bhagyas/bootbox/commit/72cd1ada43d3aa74f0dcfb10d66219fe208063af

After adding this patch to your bootbox.js, you could set an additional timeOut option in your options for bootbox.

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

Cheers.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top