1

我的网站通常是这样的在此处输入图像描述

但是当通过单击按钮显示模态时会发生这种情况,请观察模态下方的区域在此处输入图像描述

有没有办法解决这种行为?(当模态显示时导航栏元素被移位,当模态隐藏时返回正常

代码直接来自此处的示例http://twitter.github.io/bootstrap/javascript.html#modals

<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
  </div>
  <div class="modal-body">
    <p>One fine body…&lt;/p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-primary">Save changes</button>
  </div>
</div>
4

0 回答 0