我必须显示多级手风琴,为此的javascript代码是:
$('#menu li a').click(
function() {
var openMe = $(this).next();
var mySiblings = $(this).parent().siblings().find('ul');
if (openMe.is(':visible')) {
openMe.slideUp("slow");
} else {
mySiblings.slideUp("slow");
openMe.slideDown("slow");
}
}
);
HTML 代码:
<ul id="menu">
<li>
<a href="#" class="first"><span class="level-1 bdr-radius-top">
<span class="column-1"><span class="closespan"> </span><h3>europe</h3></span>
<span class="column-2"><span>9</span>pays </span>
<span class="column-3"><span>48</span>destinations </span>
</span></a>
<ul>
<li><a href="#" class="first">
<span class="level-2">
<span class="column-1"><span class="closespan"> </span><h3>états-unis</h3></span>
<span class="column-2"> </span>
<span class="column-3"> <span>7</span>destinations </span>
</span></a>
<ul>
<li><a href="#">
<div class="level-3">
<div class="column-1"> Nice - Strasbourg </div>
<div class="column-2"> Nice - Strasbourg </div>
</div></a>
</li>
<li><a href="#">
<div class="level-3">
<div class="column-1"> Nice - Strasbourg </div>
<div class="column-2"> Nice - Strasbourg </div>
</div></a>
</li>
<li><a href="#">
<div class="level-3">
<div class="column-1"> Nice - Strasbourg </div>
<div class="column-2"> Nice - Strasbourg </div>
</div>
</li>
<li><a href="#">
<div class="level-3">
<div class="column-1"> Nice - Strasbourg </div>
<div class="column-2"> Nice - Strasbourg </div>
</div></a>
</li>
</ul>
</li>
</ul>
</li>
但不幸的是,当手风琴在滑动和滑动时,整个 html 代码都在振动。所以请任何人都可以帮我解决这个问题吗?