1

我有一个使用 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();

并包含所需的库。

<script src="../bootstrap/js/bootstrap-dropdown.js" type="text/javascript"></script>

这是http://jsfiddle.net/zNVgq/2/上的代码

4

0 回答 0