Close Twitter Bootbox after x seconds

davidOhara picture davidOhara · Jul 20, 2013 · Viewed 11.2k times · Source

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) {

    }
}); 

Answer

Scott picture Scott · Jul 20, 2013

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