bootstrap模态框怎么关闭事件


本文摘自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

//触发键盘esc事件时不关闭。

});

相关推荐:《bootstrap入门教程》

自定义模态框显示和关闭触发事件:

阅读剩余部分

相关阅读 >>

浅谈css grid比bootstrap更适合创建布局的原因

bootstrap按钮样式有哪些

bootstrap怎么实现圆角

bootstrap的清除浮动

bootstrap轮播时间在哪里设置

bootstrap是哪个组织创立的

bootstrap主要是什么

bootstrap 如何取消自适应

css中的bootstrap是指什么

bootstrap被淘汰了么

更多相关阅读请进入《bootstrap》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...