为我的应用程序想要一个水平菜单。使用Bootstrap来创建它 这个http://www.bootply.com/113314例子。虽然不行。还需要帮助以了解按钮如何识别适当的列表而不指定id或名称,因为文档中有多个
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
</head>
<body>
<div align="center">
<a href="home.erp">
<img title="Home" class="img-rounded" src="images/empireSmall.png">
</a>
</div>
<div align="right">
<button class="btn btn-danger" onclick="logout()">Logout</button>
</div>
<div class="btn-group">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Administration
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="karateInvoiceApplication.erp"> Invoice Application</a></li>
<li><a href="karateStudentApplication.erp"> Karate Student</a></li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
System
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="userApplication.erp"> User Application</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
&#13;
答案 0 :(得分:5)
只是为了确认是否有其他人发现了同样的问题 - 确保在Bootstrap JavaScript之前引用了jQuery(例如bootstrap.min.js
),因为这是一个依赖项。