我在导航折叠中有一个下拉菜单。
当我减小窗口的宽度(例如:700px)时,导航栏正确折叠,然后我单击 btn-navbar 以取消折叠它,然后单击下拉菜单,但它不下拉,菜单不显示。如果那时我再次折叠并取消折叠,则下拉菜单开始工作。
当窗口的宽度从一开始就很小时,也会发生同样的情况。
就像折叠部分的高度在一开始就固定了,它不会让下拉菜单做它的事情。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-responsive.css" />
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Be sure to leave the brand out there if you want it shown -->
<a class="brand" href="#">Project name</a>
<!-- Everything you want hidden at 940px or less, place within here -->
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Anonymous <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href=''><i class='icon-chevron-right'></i> Login</a>
</li>
<li>
<a href=''><i class='icon-plus'></i> Register</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
引导程序 v2.2.0
火狐 16.0.2