我正在关注此链接bootstrap drop down menu以创建下拉菜单。当我点击按钮时,会出现一个下拉列表,当我将鼠标悬停在下拉菜单上时,只有前两个列表项可以点击,其余项目似乎是禁用/不能点击或有些事情出错。这是代码:
@if (Request.IsAuthenticated && Roles.IsUserInRole(User.Identity.Name, "teacher"))
{
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">E-portal
<span class="caret"></span>
</a>
@*<div class="dropdown">
*@
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li>@Html.ActionLink("Student", "Index", "Student")</li>
<li>@Html.ActionLink("Teacher", "Index", "Teacher")</li>
<li>@Html.ActionLink("Department", "Index", "Department")</li>
<li>@Html.ActionLink("University", "Index", "University")</li>
<li>@Html.ActionLink("Course Management", "Index", "Course")</li>
<li>@Html.ActionLink("Class Management", "Index", "Classes")</li>
</ul>
@*
</div>
*@
</div>
}
脚本:
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
我该怎么做才能让它发挥作用?
答案 0 :(得分:1)
删除class=dropdown
DIV ..
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown">E-portal
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li>...</li>
</ul>
</div>