【问题标题】:bootstrap 3 disable background after modal popup [duplicate]模式弹出后引导3禁用背景[重复]
【发布时间】:2017-02-01 23:56:12
【问题描述】:

我正在尝试使用下面给定的代码在我的代码中弹出 bootstrap 3 模式

  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="false" aria-hidden="true" data-keyboard="false">
  <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>

我想完全禁用背景,只有模态应该是活动的,像这样

我想要如下所示

这就是我得到的

【问题讨论】:

  • 我没有尝试过任何事情,因为我在互联网上的任何地方都没有找到解决方案,所以在对谷歌进行了大量研究之后,我终于在 stackoverflow 上发布了这个。
  • 尝试在控制台中删除背景。因此,您可以看到要更改的样式在哪里。我不建议使用 !important 但如果你想要一个简单的解决方案来解决这个问题。你可以使用它。先试试吧
  • 嗨,我刚刚更改了模态类的 zindex,它按照我的要求工作,.modal{ z-index: 99999; }
  • 那你应该删除这个问题;)
  • 确定为什么不;)

标签: javascript jquery html twitter-bootstrap bootstrap-modal


【解决方案1】:

试试这个

$('#myModal').modal({backdrop: 'static', keyboard: false})  ;

更多信息Here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 1970-01-01
    • 2018-05-19
    • 2018-01-18
    • 1970-01-01
    • 2014-02-24
    • 2019-06-27
    相关资源
    最近更新 更多