是否有可能在10秒后关闭twitter bootbox?我打开它是这样的:关闭微博Bootbox后x秒
bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) {
if (result) {
}
});
是否有可能在10秒后关闭twitter bootbox?我打开它是这样的:关闭微博Bootbox后x秒
bootbox.confirm("{{$steps[0]}}","accept","decline" ,function(result) {
if (result) {
}
});
此代码将在10秒后自动关闭打开的bootbox。
window.setTimeout(function(){
bootbox.hideAll();
}, 10000); // 10 seconds expressed in milliseconds
我只是犯了一个补丁,将这一功能添加到bootbox。
它可以在下面的链接中找到。
https://github.com/bhagyas/bootbox/commit/72cd1ada43d3aa74f0dcfb10d66219fe208063af
加入这个补丁,以您的bootbox.js后,你可以设置你的选项bootbox额外的超时选项。
bootbox.dialog({
message : "Your operation completed successfully.",
timeOut : 2000
});
干杯。
哇,这是工作完美!另一个问题,我可以显示在bootbox剩余的秒数?! – davidOhara
@chrizstone很高兴帮助。您需要将其作为另一个问题发布,这会涉及更多的问题。如果这回答了原始问题,不要忘记选择它作为答案。谢谢 – Scott