我按navbar
创建了DropDown
,但现在将其复制到我的新项目中。但它不起作用。
jquery和bootstrap的版本是一样的。
头是
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/jquery-3.1.1.min.js"></script>
<link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
身体
<nav class="navbar navbar-default navbar-fixed-top" id="nav">
<nav class="navbar navbar-default navbar-fixed-top" id="nav">
<div>
<ul class="nav navbar-nav">
<li class="active btn-info"><a><span class="glyphicon glyphicon-phone"></span> phone</a></li>
<li><a><span class="glyphicon glyphicon-file"></span> file</a></li>
<li><a><span class="glyphicon glyphicon-fire"></span> fire</a></li>
<li><a><span class="glyphicon glyphicon-usd"></span> store</a></li>
<li class="dropdown-toggle dropdown"><a><span class="glyphicon glyphicon-pause"></span> Tests <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a></a> test 1</li>
<li><a></a> test 1</li>
<li><a></a> test 1</li>
<li><a></a> test 1</li>
</ul>
</li>
</ul>
</div>
</nav>
</nav>
<div>
@RenderBody()
</div>
答案 0 :(得分:0)
##
试试这段代码:
<a data-toggle="dropdown">
<span class="glyphicon glyphicon-pause"></span> Tests <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>test 1</li>
<li> test 1</li>
<li> test 1</li>
<li> test 1</li>
</ul>
</li>
</ul>