gpt4 book ai didi

javascript - 警告前出现 BB 对话框

转载 作者:行者123 更新时间:2023-12-03 09:52:55 26 4
gpt4 key购买 nike

JSFiddle Link:

bootbox.alert 应显示在 bootbox.dialog 之前。我已将所有库预加载到 JSFiddle 中。我希望在单击 bootbox.alert 后显示 bootbox.dialog

最佳答案

查看一下 here

Bootbox定义了它们的功能here ,正如您所看到的,它们包含一个回调。例如:

bootbox.alert(message, callback)

回调为您提供了仅在该行完成后运行某些代码的选项。这可以解决您的问题。

JS

$(document).ready(function () {
$('.begin-game').click(function () {
bootbox.alert("This should show up first", function () {
bootbox.dialog({
message: "Did you pass Go?",
title: "This should go second / last",
buttons: {
// Passed go
success: {
label: "Yes I Passed GO!",
className: "btn-success",
callback: function () {

}
},
// Did not pass go
danger: {
label: "I did not :(",
className: "btn-danger",
callback: function () {

}
},
}
});
});
});
});

关于javascript - 警告前出现 BB 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30830851/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com