bootstrap 模态框关闭状态怎么获取

时间:2022-02-11 23:12:59

比如现在有个场景,一个事件 需要在模态框关闭之后再执行自己的逻辑,先上图:

bootstrap 模态框关闭状态怎么获取

参考官网说明:http://v3.bootcss.com/javascript/#modals-events

//每次关闭模态框,对当前的页面进行一次刷新操作,清空数据
$(function () { $('#addstraModal').on('hide.bs.modal', function () {
//alert('嘿,我听说您喜欢模态框...');
setTimeout(function(){
$("#saveForm").find(":input").each(function(){
$(this).val("");
});
location.reload();
},300);
}); });