bootstrap模式不能正常工作

时间:2017-01-20 07:40:04

标签: twitter-bootstrap bootstrap-modal

我已经创建了一个导航栏,在此导航栏中我已登录选项。一旦我点击它,我想在窗口中弹出一个登录。所以我创建了一个模态引导程序,它的功能是它可以工作但是一旦它出现整个屏幕变暗而不是除了弹出模式之外的所有东西。知道我在哪里弄错了吗?

  <header id="mu-header">  
    <nav class="navbar navbar-default mu-main-navbar" role="navigation">  
      <div class="container">
        <div class="navbar-header">
          <!-- FOR MOBILE VIEW COLLAPSED BUTTON -->
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <!-- LOGO -->                                                        
          <!--  Image based logo  -->
          <a class="navbar-brand" href="index.html"><img src="assets/img/logo.png" alt="Logo img"></a> 
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul id="top-menu" class="nav navbar-nav navbar-right mu-main-nav">
            <li><a href="#mu-reservation">Order Here</a></li> 
            <li><a href="#mu-restaurant-menu">MENU</a></li>   
            <li><a href="#mu-gallery">GALLERY</a></li>
            <li><a href="#mu-contact">CONTACT</a></li>
            <li><a href="#mu-slider">HOME</a></li>
            <li><a href="#mu-about-us">ABOUT US</a></li>                  
            <li><a class="login" data-toggle="modal" data-target="#myModal">Login</a></li>
          </ul>                            
        </div><!--/.nav-collapse -->       
      </div>          




    </nav> 


    <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Modal Header</h4>
        </div>
        <div class="modal-body">
          <p>This is a large modal.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>

enter image description here

1 个答案:

答案 0 :(得分:0)

有时,bootstrap模式在包含position: relative;position:fixed;的元素内部时会这样做。看看是否属于这种情况。