【发布时间】:2015-12-17 03:19:58
【问题描述】:
我正在学习引导程序,我正在尝试将下拉插件添加到我的网页。但插件显示在输出中,但它不起作用。请检查我的代码并告诉我是否正确。
<div class="dropdown">
<button type="button" class="btn btn-default btn-md dropdown-toggle" data-toggle="dropdown" aria-expanded="true" id="dropdownMenu1">
Product-type<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" href="#">Computers</a></li>
<li role="presentation"><a role="menuitem" href="#">Laptops</a></li>
<li role="presentation"><a role="menuitem" href="#">Mobiles/Tablets</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" href="#">Components</a></li>
<li role="presentation"><a role="menuitem" href="#">Accessories</a></li>
</ul>
</div>
我已经在 head 部分添加了引导文件和 jquery 文件的远程链接
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
请帮帮我。我真的需要知道,我在这里做错了什么!
【问题讨论】:
-
在
bootsrap.js之前导入jquery.js
标签: jquery html twitter-bootstrap drop-down-menu dropdown