2014-10-20 73 views
0

網頁運行正常,但當我更改它的大小(縮小)並單擊按鈕時,它不會摺疊。下面是我的代碼。在引導程序中摺疊不起作用

<!DOCTYPE html> 
    <html> 
     <head> 
      <title>Template 1</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
      <link rel="stylesheet" href="css/bootstrap.min.css"> 

     </head> 

     <body> 

      <div class="navbar navbar-inverse navbar-static-top"> 
       <div class="container"> 
        <a href="#" class="navbar-brand">zdfgdfgf</a> 
        <a class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse"> 
         <span class="icon-bar"></span> 
         <span class="icon-bar"></span> 
         <span class="icon-bar"></span> 

        </a> 

        <div class = "collapse navbar-collapse navHeaderCollapse"> 
         <ul class = "nav navbar-nav navbar-right"> 
          <li class="active"><a href = "#">Home</a></li> 
          <li><a href = "#">Social media</a></li> 
          <li><a href = "#">About</a></li> 
          <li><a href = "#">Contact</a></li> 


         </ul> 
        </div> 
       </div> 
      </div> 

      <script src="js/bootstrap.js"></script> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
     </body> 
    </html> 

任何人都可以幫忙嗎?

this happened after fixing the collapsing problem using the 1st answer

回答

1

一個問題是,bootstrap.js必須jQuery的後加載,這樣的:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
<script src="js/bootstrap.js"></script> 
+0

是固定崩潰的問題。但現在它正在崩潰,如圖片above..I需要從下一行摺疊它,這意味着Home鏈接應該到達下一行。 – Sanjaya 2014-10-20 15:43:44

+0

這裏是一個jsfiddle(假設bootstrap 3)[示例](http://jsfiddle.net/0e9peu3r/) – Macsupport 2014-10-20 16:24:00

+0

thanx thanx很多:) – Sanjaya 2014-10-20 16:31:14