2012-09-10 197 views
7

我可能錯過了一些相當小的東西,這讓我很沮喪,因爲我一直坐在這裏幾個小時,現在試圖解決這個問題。導航欄將不會與Javascript鏈接。當窗口正確調整大小時會出現按鈕,但單擊時不會摺疊菜單。Bootstrap Responsive Nav Bar

快看看我在我的頭鏈接(以防萬一,他們是在錯誤的順序)

<link rel="stylesheet" href="/assets/css/bootstrap.css"> 
<link rel="stylesheet" href="/assets/css/bootstrap-responsive.css"> 
<link rel="stylesheet" href="/assets/css/style.css?v=2"> 

<script src="/assets/js/bootstrap.js"></script> 
<script src="/assets/js/bootstrap.min.js"></script> 
<!-BootStrap--><script src="/assets/js/jquery-1.7.1.min.js"></script> 
<script src="/assets/js/jquery.validate.min.js"></script> 
<script src="/assets/js/script.js"></script> 
<script src="/assets/js/bootstrap-fileupload.js"></script> 

在我的HTML快看 -

<div class="navbar navbar-fixed-top"> 
    <div class="navbar-inner"> 
    <div class="container"> 
    <!--<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">--> 
    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     </a> 
    <div class="span4"> 
     <a href="{site_url}" title="People Team"> 
     <img src="/assets/img/logo.png" alt="People Team Logo" /> 
     </a> 
    </div> 
    <nav> 
     <div class="nav-collapse"> 
     <ul class="nav"> 
     <li{if segment_1 == ""} class="active"{/if}> 
      <a href="/" title="Home">Home</a> 
     </li> 
     <li{if segment_1 == "services"} {/if}> 
      <a href="/services" title="Contact People Team">Services</a> 
     </li> 
     <li{if segment_1 == "about"} {/if}> 
      <a href="/about" title="About People Team">About the team</a> 
     </li> 
     <li{if segment_1 == "contact"} {/if}> 
      <a href="/contact" title="Contact People Team">Contact Us</a> 
     </li> 
     </ul> 
    </div> 

我以爲JavaScript是內Bootstrap.min.js或Bootstrap.js文件,它們是導航欄工作所必需的。我只是被困住了。任何幫助,將不勝感激。

乾杯,

回答

5

更改順序,你的JS載荷。jQuery的第一,引導插件第二。

<script src="/assets/js/jquery-1.7.1.min.js"></script> 
<script src="/assets/js/bootstrap.js"></script> -- remove, as it is not really needed when including the minified version 
<script src="/assets/js/bootstrap.min.js"></script> 
+2

你是一個救星。非常感謝您的幫助! – user1658953