0
我想弄清楚如何隱藏其他子菜單項並單擊菜單。現在,當兩個菜單都被點擊時,它們都顯示出來,我不想要。單擊菜單時我想隱藏其他菜單項
<script type="text/javascript" src="jquery/js/jquery-1.9.1.js"></script>
<script src="jquery/js/jquery-ui-1.10.3.custom.js"></script>
<script>
jQuery(function ($) {
$(".accordion").accordion({
active: false,
autoHeight: false,
collapsible: true,
alwaysOpen: false
});
function collapseAll() {
$("#accordion")
.filter(":has(.ui-state-active)")
.accordion("activate", -1);
$(".ui-accordion-header").blur();
}
});
<div class="navigation">
<ul class="accordion">
<li>
<asp:HyperLink ID="about" runat="server" href="#" text="testing" />
<div class="sub accordion">
<ul>
<li><asp:HyperLink ID="aboutTraci" runat="server" NavigateUrl="traci.aspx" Text="Traci" /></li>
<li><asp:HyperLink ID="aboutTheBegan" runat="server" NavigateUrl="#" Text="How It All Began" /></li>
<li><asp:HyperLink ID="aboutDesigners" runat="server" NavigateUrl="#" Text="Designers" /></li>
<li><asp:HyperLink ID="aboutPlaygroup" runat="server" NavigateUrl="#" Text="Playgroup" /></li>
<li><asp:HyperLink ID="aboutPlayground" runat="server" NavigateUrl="#" Text="Playground" /></li>
<li><asp:HyperLink ID="aboutTestimonials" runat="server" NavigateUrl="testimonials.aspx" Text="Testimonials" /></li>
</ul>
</div>
</li>
</ul>
<ul class="accordion">
<li>
<asp:HyperLink ID="HyperLink1" runat="server" href="#" Text="testing" />
<div class="sub accordion">
<ul>
<li><asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="traci.aspx" Text="Traci" /></li>
<li><asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="#" Text="How It All Began" /></li>
<li><asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="#" Text="Designers" /></li>
<li><asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="#" Text="Playgroup" /></li>
<li><asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="#" Text="Playground" /></li>
<li><asp:HyperLink ID="HyperLink7" runat="server" NavigateUrl="testimonials.aspx" Text="Testimonials" /></li>
</ul>
</div>
</li>
</ul>
</div>
我想隱藏其他菜單項被點擊時一個。
謝謝