jquery – 使用bootbox不会触发show事件

我无法捕获bootBox.confirm对话框的show事件,以便在显示之前对对话框进行一些css调整.

我尝试过以下事情,但没有成功:

$(document).on("show.bs.modal",function (event) {...});
$(document).on("show",".bootBox",function (event) {...});

解决方法

这应该适用于您使用BootBox 4.x.x和Bootstrap 3.x.x:
var Box = bootBox.dialog({
  message: '',title: '',buttons: {},show: false
});

Box.on("shown.bs.modal",function() {
  alert('it worked!');
});

Box.modal('show');

或者这样:

$(document).on("shown.bs.modal",function (event) {...});

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...