javascript引导程序模式-取消关闭 [英] javascript bootstrap modal - cancel closing

查看:66
本文介绍了javascript引导程序模式-取消关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作正在使用javascript bootstrap 2.0.4

my work is using javascript bootstrap 2.0.4

我正在寻找一种通过逻辑控制取消关闭模态的方法. 但我找不到任何详细信息

I'm looking for a way to cancel the modal from closing, by logic control. but I can't find any details how to do this

http://getbootstrap.com/javascript/#modals

.NET之类的

OnWindowClosing(eventArguement) 
{ 
    if (shouldCancel) {
      eventArguement.Cancel = true; 
      return;
    }
}

推荐答案

在这里查看: www.bootply.com/QTTDf3zRgV

在此示例中,如果选中此复选框,则无法关闭模式(使用js/jquery):

In this exemple, if the checkbox is checked, then the modal can't be closed ( with js/jquery):

$('#myModal').on('hide.bs.modal', function(e){
  if( $('#block').is(':checked') ) {
     e.preventDefault();
     e.stopImmediatePropagation();
     return false; 
   }
});

这篇关于javascript引导程序模式-取消关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆