我无法捕获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) {...});