2016-03-08 82 views
0

我想跟隨引導按鈕下拉,但不工作。Bootstrap下拉按鈕不起作用的版本3.3.6

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" > 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" 
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script> 


<div class="dropdown" style="display: block;"> 
    <ul class="dropdown-menu"> 
     <li><a href="#" tabindex="-1">Walter</a></li> 
     <li><a href="#" tabindex="-1">Bunny</a></li> 
     <li><a href="#" tabindex="-1">Big Lewaoaski</a></li> 
    </ul> 
</div> 

編輯:

<!DOCTYPE html> 
<html> 
<head> 

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" > 

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" > 
<link rel="stylesheet" href="https://bootswatch.com/cosmo/bootstrap.min.css" > 


<!-- Latest compiled and minified JavaScript --> 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
    <title>Components Tutorial</title> 
</head> 
<body> 
<div class="dropdown" style="display: block;"> 
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> 
     Dropdown Example <span class="caret"></span> 
    </button> 
    <ul class="dropdown-menu"> 
     <li><a href="#" tabindex="-1">Walter</a></li> 
     <li><a href="#" tabindex="-1">Bunny</a></li> 
     <li><a href="#" tabindex="-1">Big Lewaoaski</a></li> 
    </ul> 
</div> 
</body> 
</html> 
+0

你有一個失蹤的引導,theme.min.css'>'。不知道是否有錯字。 –

回答

2

除了缺少>如果不是筆誤,你是不是包括下拉按鈕來切換菜單。

例如

<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> 
    Dropdown Example <span class="caret"></span> 
</button> 

所以把那您當前的代碼:

<div class="dropdown" style="display: block;"> 
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> 
     Dropdown Example <span class="caret"></span> 
    </button> 
    <ul class="dropdown-menu"> 
     <li><a href="#" tabindex="-1">Walter</a></li> 
     <li><a href="#" tabindex="-1">Bunny</a></li> 
     <li><a href="#" tabindex="-1">Big Lewaoaski</a></li> 
    </ul> 
</div> 

Example Fiddle

+0

^^正確。沒有什麼可以切換下降 – JoeyG

+0

作出的更改,仍然沒有切換,發佈編輯 – Simsons

+0

@Simsons嗯這很奇怪。我試着將你的整個代碼粘貼到[plunker](https://plnkr.co/edit/uZWCrQ9GNJ7b3a9flJbF?p=preview),它也可以。一個愚蠢的問題,但是,您的索引文件位於桌面? –