BootStrap Modal

Modal js调用开启:

$( '#confirmDilog' ).modal({
       keyboard:true,
       show:true,
    });


Modal js调用关闭:

$( '#confirmDilog' ).modal( ‘hide’ );

.modal('toggle')

手动打开或隐藏一个模态对话框。

 $('#myModal').modal('toggle')

.modal('show')

手动打开一个模态对话框。

  $('#myModal').modal('show')

.modal('hide')

手动隐藏一个模态对话框。

  $('#myModal').modal('hide')

Modal 清除数据:

//Bootstrap v2

 $("#confirmDilog").on("hide", function() {
       $(this).removeData("modal");
  });

//Bootstrap v3

$("#confirmDilog").on("hidden.bs.modal", function() {
         $(this).removeData("bs.modal");
});

BootStrap 自定义Modal 显示剧中:

<!-- 小小提示框  -->
<div id="litModal" style="width:400px;" class="modal fade modal-xs" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
   <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">提示信息</h4>
      </div>
      <div class="modal-body" id="tipDialog"></div>
    </div>
</div>
<!-- 小小提示框  -->

$( '#tipDialog' ).html( '请选选择该角色的权限' );
//设置提示框属性
$('#litModal').modal({
	keyboard:true,
	show:true,
	backdrop:false,
});
//设置提示框的css样式(居中展示)
$("#litModal").modal().css({
   "margin-top": function () {
      return ($(this).height() / 10 );
   },
   "margin-left": function () {
      return ($(this).width() / 4 );
    },
});


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值