因此,我尝试将模式放在菜单中的链接<li>上,但是当我单击它时,页面的滚动条消失了。

看,这是我的菜单:

<nav class="navbar navbar-default bg-primary">
      <ul class="nav navbar-nav navbar-right">
        <li ><a href="#myModal" role="button" data-toggle="modal">History</a></li>
              <!-- Modal -->
<div class="modal fade" role="dialog" id="myModal" tabindex="-1" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <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 fontblue" id="myModalLabel"> Project</h4>
      </div>
      <div class="modal-body">
<p class="line">
This page is... x x x
</p>
      </div>
    </div>
  </div>
</div>
      </ul>
</nav>


我以多种形式称呼“ js”

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>






看一下滚动条的区别。

最佳答案



divName.modal-open {
   overflow: scroll;
  }


这将在引导的v3中工作

关于css - 在Bootstrap上使用模式时滚动条消失,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28695464/

10-13 22:09