模态框事件
$('.ModalAlert').on('show.bs.modal', function () {
console.log("准备打开模态框");
})
$('.ModalAlert').on('shown.bs.modal', function () {
console.log("已经打开模态框");
})
$('.ModalAlert').on('hide.bs.modal', function () {
console.log("准备关闭模态框");
})
$(".ModalAlert").on("hidden.bs.modal",function(){
if ($(".ModalPage").css("display") == "block" && $("body").hasClass("modal-open") == false){
$("body").addClass("modal-open");
}
console.log("已经关闭模态框");
});
参考
https://www.runoob.com/bootstrap/bootstrap-modal-plugin.html
https://www.runoob.com/bootstrap4/bootstrap4-modal.html
https://v4.bootcss.com/docs/components/modal/