关于bootstrap中多层模态框关闭之后主页面的滚动卡死
解决:
解决方法很简单,如果想要在子modal关闭后,父modal可以正常滚动,只需要在子modal的窗口关闭事件中加入
childModal.on(“hidden.bs.modal”, function () {
$(‘body’).addClass(‘modal-open’);
});
这样还有一个问题就是页面重新加载,页面中的数据会丢失,所以还需要再重新加载数据。
如果想要子modal在打开时,就可以正常滚动,只需要在子modal窗口的打开事件中加入
childModal.on(“show.bs.modal”, function () {
setTimeout(function(){
$(‘body’).addClass(‘modal-open’);
},500);
})