Bootstrap Modal仅适用于移动设备


Bootstrap Modal Works On Mobile Device Only

你好,

我创建了一个bootstrap 3模式,它在我的移动设备上工作,但在我的桌面上,当你点击按钮时,它不会打开模式。

我试过调整模态框的大小,甚至调整它的zindex,但这些都没有解决问题。

有人知道我有什么问题吗?

<div class="container-fluid formbox ">
  <div id="cageModal" class="modal fade" role="dialog" class="col-sm-10 col-sm-offset-1">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Cage The Great</h4>
        </div>
        <div class="modal-body">
          <iframe width="100%" height="100%" src="https://www.youtube.com/embed/VqghSmwdnpg" frameborder="no" allowfullscreen></iframe>
          <button type="button" class="btn btn-default" data-dismiss="modal">See More</button>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="container-fluid formbox ">
  <div class="col-xs-12 col-sm-12">
    <h3>Get Familiar with the artists below.</h3>
    <div class="col-xs-8 col-xs-offset-2 col-sm-6 col-sm-offset-3">
      <div>  <button type="button" class="btn btn-block btn-info btn-lg" data-toggle="modal" data-target="#cageModal">Cage The Great</button>
      </div>
    </div>
  </div>
</div>

jfiddle 上的非工作代码

您的代码是正确的。但是你的引导引用(CDN)不是。

将您对Bootstrap的引用替换为最新的。或者更好的是,在本地使用Bootstrap,永远不要碰它!

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

这是您损坏的jfiddle,现在正在使用