0
我不能處理內層菜單隻有外層菜單打開好 任何人有一個想法如何處理它?jquery - 下拉菜單打開內部菜單
HTML:
<nav id="menu-nav">
<ul>
<li class="top">
<a href="#">Reports</a>
<ul>
<li>
<a href="#">Credit Balance</a>
<ul>
<li>Sales</li>
<li>Float Credit</li>
<li>Consumed Credit</li>
</ul>
</li>
<li>
<a href="#">Calls</a>
<ul>
<li>Client Calls</li>
<li>Expert Calls</li>
<li>Current Calls</li>
<li>Errors</li>
</ul>
</li>
<li>
<a href="#">Users/Experts</a>
<ul>
<li>Users Report</li>
<li>Expertest Report</li>
</ul>
</li>
</ul>
</li>
<li class="top">
<a href="#">Support</a>
<ul>
<li>New Tickets</li>
<li>Open Tickets</li>
<li>Archived Tickets</li>
</ul>
</li>
<li>User Management</li>
<li>Packages Managments</li>
<li class="top">
<a href="#">Application Managments</a>
<ul>
<li>Notification Manager</li>
<li>Application Settings</li>
</ul>
</li>
</ul>
</nav>
的jQuery:
$(document).ready(function() {
$("#menu-nav").click(function(e){
e.stopPropagation(); // this stops the bubbling from going any higher
});
$('body').click(function(){ // this is only reached if the clicks comes outside the #menu-nav
$("#menu-nav ul ul").slideUp('fast');
});
$("#menu-nav ul li.top").click(function() {
$("#menu-nav ul ul").slideUp("fast", function(){});
$("ul:first", this).slideDown("fast", function(){
$("ul", this).slideUp("fast");
});
});
});
我沒有;知道你可以返回false阻止其他腳本。謝謝! – DanR