我按照了我看过的教程中的所有说明,但响应式菜单没有扩展?即使是下拉列表也不起作用。当我点击按钮时没有发生任何事情,它只会改变它的颜色。我能做错什么?
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title></title>
<!-- Bootstrap -->
<link href="view/css/bootstrap.min.css" rel="stylesheet">
<link href="view/css/styles.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="view/js/bootstrap.min.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="view/images/logo.png">
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">The Institution <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="">About the Institute</a></li>
<li><a href="">Research & Programs</a></li>
<li><a href="">Board of Advisers</a></li>
<li><a href="">Educational Quality Team</a></li>
</ul>
</li>
<li><a href="#">The Center</a></li>
<li><a href="#">Opportunity</a></li>
<li><a href="#">Get In Touch</a></li>
</ul>
</div>
</div></div>
JS
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
答案 0 :(得分:0)
你有两次bootstrap.js,一次加载jQuery之前。删除
<script src="view/js/bootstrap.min.js"></script>
在你的头部