使用BootstrapDialog.show时禁用外部单击

时间:2016-08-30 12:51:42

标签: javascript jquery html5 twitter-bootstrap css3

我正在使用BootstrapDialog.show作为模态,我希望模态能够持久存在,即使在模态之外有点击或触摸(移动)事件。设置背景静态效果为html不适用于 BootstrapDialog。显示

BootstrapDialog.show({
        title: 'Logout',
        message: "Do you want to Logout?",
        buttons: [{
            label: 'Cancel',
            action: function (dialog) {
                dialog.close();
            }
        }, {
            label: 'OK',
            action: function (dialog) {
                window.localStorage.removeItem("access_token");
                dialog.close();
                location.href = "login.html";
            }
        }]
    });

我想禁用外部点击。

1 个答案:

答案 0 :(得分:0)

您应该将closable : false添加到Bootstrap对话框中。