本文摘自PHP中文网,作者爱喝马黛茶的安东尼,侵删。

模态框避免点击背景处关闭:
1、div初始化时添加属性 aria-hidden=”true” data-backdrop=”static”
1 2 | <div class = "modal fade" id= "edit" tabindex= "-1" role= "dialog" aria-labelledby= "myModalLabel" aria-hidden= 'true'
data-backdrop= 'static' >
|
2、在需要显示模态框,初始化时
1 2 3 4 5 6 | $(‘#myModal').modal({
backdrop: ‘ static ',
keyboard: false
});
|
相关推荐:《bootstrap入门教程》
自定义模态框显示和关闭触发事件:
阅读剩余部分
相关阅读 >>
bootstrap layout it怎么使用
bootstrap的优缺点是什么?
bootstrap命令是什么意思
浅谈bootstrap表单验证插件bootstrapvalidator
jquery和bootstrap的区别是什么?
bootstrap怎么实现响应式布局
elementui和bootstrap区别
浅谈bootstrap中的panel布局
bootstrap怎么适配
bootstrap表单怎么居中
更多相关阅读请进入《bootstrap》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap模态框怎么关闭事件