Domanda

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

    }
}); 
È stato utile?

Soluzione

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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top