2016-08-12 74 views
0

我正在練習使用Bootstrap 3.3.7創建一個導航欄,並且當我點擊它時下拉不起作用。我有我的腳本正確引用,我有最新版本的jQuery,但它仍然沒有發展。代碼如下。誰能幫忙?爲什麼點擊它時我的導航欄中沒有下拉菜單?

!DOCTYPE html> 
<html lang="EN-US"> 
<head> 
    <title></title> 
    <link rel="stylesheet" href="Styles/bootstrap.min.css" /> 
</head> 
<body> 

    <nav class="navbar navbar-default" role="navigation"> 
     <!-- Brand and toggle get grouped for better mobile display --> 
     <div class="navbar-header"> 
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> 
       <span class="sr-only">Toggle navigation</span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
      </button> 
      <a class="navbar-brand" href="#">Title</a> 
     </div> 

     <!-- Collect the nav links, forms, and other content for toggling --> 
     <div class="collapse navbar-collapse navbar-ex1-collapse"> 
      <ul class="nav navbar-nav"> 
       <li class="active"><a href="#">Link</a></li> 
       <li><a href="#">Link</a></li> 
      </ul> 
      <form class="navbar-form navbar-left" role="search"> 
       <div class="form-group"> 
        <input type="text" class="form-control" placeholder="Search"> 
       </div> 
       <button type="submit" class="btn btn-default">Submit</button> 
      </form> 
      <ul class="nav navbar-nav navbar-right"> 
       <li><a href="#">Link</a></li> 
       <li class="dropdown"> 
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> 
        <ul class="dropdown-menu"> 
         <li><a href="#">Action</a></li> 
         <li><a href="#">Another action</a></li> 
         <li><a href="#">Something else here</a></li> 
         <li class="divider"></li> 
         <li><a href="#">Separated link</a></li> 
        </ul> 
       </li> 
      </ul> 
     </div><!-- /.navbar-collapse --> 
    </nav> 
    <script src="Scripts/jquery-3.1.0.min.js"></script> 
    <script src="Scripts/bootstrap.min.js"></script> 
</body> 

+1

我想舉3具有與jQuery 3個問題,改變的jQuery的版本是無論是1.12或2.x和看它是否有差別。 – epascarello

+0

瀏覽器控制檯告訴你什麼? –

+0

@epascarello耶,顯然這是一個引導3和jquery 3的問題。我改成了jquery 2.2.4,它工作的很完美!非常感謝 – fullyloaded314

回答

相關問題