我有一个使用twitter bootstrap的两个下拉列表,但是我有一个小问题..当选择菜单时,子项出现,然后在下次没有。 Html代码:
<ul class="nav nav-pills left">
<li class="dropdown" id="menu1">
<a class="dropdown-toggle" style="color:#fff;" data-toggle="dropdown" href="#menu1"><i class="icon icon-user icon-white">
</i> My Account <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="OldReports.aspx">Previouse Report</a></li>
<li><a href="Profile.aspx">My Profile</a></li>
<li class="divider"></li>
<li>
<asp:LinkButton ID="lbtnLogout" runat="server" CausesValidation="false" ForeColor="Black">Log out</asp:LinkButton></li>
</ul>
</li>
<li class="dropdown active" id="menu2">
<a class="dropdown-toggle" data-toggle="dropdown" href="#menu2"><span class="badge-notification badge badge-error">
<asp:Label ID="lblMsgCount" CssClass="lblMsgCount" runat="server" Text=".."></asp:Label></span>
<i class="icon icon-envelope icon-white">
</i> Notificatons <span class="caret"></span></a>
<ul ID="divNewNotifications" class="dropdown-menu">
</ul>
</li>
</ul>
JavaScript代码:
$('.dropdown-toggle').dropdown();
并包含所需的lib。
<script src="../bootstrap/js/bootstrap-dropdown.js" type="text/javascript"></script>
上的代码