2012-12-28 31 views
2

我試圖讓Bootstrap與標籤一起工作,但由於某種原因,無論我嘗試什麼,他們都無法正常工作。它們顯示正確,但點擊鏈接時標籤不會更改。令人困惑的是,我甚至沒有再使用我的代碼 - 我在代碼中複製粘貼,該代碼應該屬於已經作爲其他問題的答案提交的「工作示例」。Twitter Bootstrap - 即使在使用工作示例時Tabs也不起作用

這是我正在使用的最新代碼。它在提交它的小提琴中完美地工作,作爲對另一個問題的答案,並且除了我試圖測試它的地方以外的任何地方都可以正常工作。我已經將該文件作爲直接的HTML打開,由Django運行時服務器提供服務,並由Apache服務器提供服務,似乎沒有任何工作。

http://jsfiddle.net/ivobos/fuBK6/

<html> 
    <head> 
     <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> 
     <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tab.js"></script> 
     <script src="http://code.jquery.com/jquery-1.7.1.js"></script> 
     <title>TabTest</title> 
    </head> 
    <body> 
     <div class="tabbable"> 
      <ul class="nav nav-tabs"> 
      <li class="active"><a href="#tab1" data-toggle="tab">tab1</a></li> 
      <li><a href="#tab2" data-toggle="tab">tab2</a></li> 
      </ul> 
      <div class="tab-content"> 
       <div id="tab1" class="tab-pane active">tab1 content</div> 
       <div id="tab2" class="tab-pane">tab2 content</div> 
      </div> 
     </div> 
    </body> 
</html> 

回答

7

嘗試移動你上面的腳本bootstrap-tabs.jsjquery-1.7.1.js腳本。

<head> 
    <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> 
    <script src="http://code.jquery.com/jquery-1.7.1.js"></script> 
    <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tab.js"></script> 
    <title>TabTest</title> 
</head> 
+0

完全合作,謝謝。有點惱火,這是它所採取的,並希望有一個關於它的說明。 –

+0

感謝您的回答! – shaz

相關問題