bootstrap- 模态框

bootstrap 官方实例…(゜▽゜)

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

在这里插入图片描述
在这里插入图片描述

模态框の 打开&关闭 方法.

第一种: 属性添加

开:    data-toggle="modal" data-target="#myModalID" 
关:  data-dismiss="modal" 

第二种: jquery操作

开:    $("#myModalID").modal("show");
关:  	$("#myproModal").modal("hide");

zombieiii : https://blog.csdn.net/qq_41094691/article/details/87855339


模态框の
打开&关闭时需要操作 的方法.

当模态框显示要触发的函数

$('.model').on("show.bs.modal",function(){
    console.log("model show");
});


当模态框关闭要触发的函数

$('.model').on("hide.bs.modal",function(){
    console.log("model close");
});

作者:lvyweb
链接:https://www.jianshu.com/p/7517144013a0
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
 $('#mymodel').on('hide.bs.modal', function () {
           alert('模态框关闭了');
   });

模态框の
避免点击背景处关闭:

第一种: 属性添加

aria-hidden=”true” data-backdrop=”static”

<div class="modal fade" id="edit" tabindex="-1" role="dialog" 
aria-labelledby="myModalLabel" aria-hidden='true' data-backdrop='static'>

第二种: jquery操作

$(‘#myModal’).modal({
backdrop: ‘static’, 
//点击背景空白处不被关闭; 
keyboard: false
//触发键盘esc事件时不关闭。
}); 

作者:Lucy- 
来源:CSDN 
原文:https://blog.csdn.net/lm1022/article/details/79246673 
版权声明:本文为博主原创文章,转载请附上博文链接!

在这里插入图片描述
关于bootstrap分页,模态框,实现邮件列表的分页,和模态框添加邮件的功能:
https://blog.csdn.net/qq_29357263/article/details/52805956


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值