引导下拉菜单不会下拉
我已经在一个页面上实现了一个引导程序导航栏,它可以像我期望的那样工作,除了一件事情。 当它被折叠并且链接被压缩到汉堡菜单中时,我将它下拉。 我想我错过了class =“dropdown-toggle”data-toggle =“dropdown”的一些变化,但他们去了哪里? 谢谢!
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" type="text/css" href="content/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="content/custom.css" />
<script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header"></div>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<p class="navbar-text navbar-right nav-bar-text"><a href="default.aspx" class="navbar-link">Home</a></p>
</li>
<li>
<p class="navbar-text navbar-right nav-bar-text"><a href="Ajax.aspx" class="navbar-link">Ajax Demo</a></p>
</li>
<li>
<p class="navbar-text navbar-right nav-bar-text"><a href="nonAjax.aspx" class="navbar-link">No Ajax Demo</a></p>
</li>
<li>
<p class="navbar-text navbar-right nav-bar-text"><a href="jQuery.aspx" class="navbar-link">jQuery Demo</a></p>
</li>
</ul>
</div>
</nav>
<asp:ContentPlaceHolder ID="ContentPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
它看起来像你只是缺少对bootstrap.js的引用,我将它添加到这个小提琴中,它工作。
https://jsfiddle.net/pqhwzrs8/
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
链接地址: http://www.djcxy.com/p/94563.html
上一篇: bootstrap dropdown won't dropdown
下一篇: Bootstrap 3 Navbar Collapse menu at Left for left and right navbar items