基本的に、多層スライドダウンクリックメニューを作成しようとして、サブメニューをslideDownにしましたが、子をクリックしたときに親がslideUp-ingを停止する方法がわかりません。助けてくれてありがとう!
HTML コード ------------------------------------------------ ------------------------
<!--Nav Menu 1-->
<ul class="make">Club Car
<ul class="model" style="display: none">Precedent
<ul class="product" style="display: none">Brush Guard</ul>
<ul class="product" style="display: none">Lift Kits</ul>
</ul>
<ul class="model" style="display: none">DS
<ul class="product" style="display: none">Brush Guard</ul>
<ul class="product" style="display: none">Lift Kits</ul>
</ul>
</ul>
<!--- Nav Menu 2-->
<ul class="make">E-Z-Go
<ul class="model" style="display: none">TXT
<ul class="product" style="display:none">Brush Guard</ul>
<ul class="product" style="display:none">Lift Kits</ul>
</ul>
<ul class="model" style="display: none">RXV
<ul class="product" style="display:none">Brush Guard</ul>
<ul class="product" style="display:none">Lift Kits</ul>
</ul>
Jquery スクリプト ------------------------------------------------ --
<script>
$("ul.make").click(function () {
if ($(this).children('ul').is(":hidden")) {
$(this).children('ul').slideDown("fast");
}
else {
$(this).children('ul').slideUp("fast");
}
});
$("ul.model").click(function () {
if ($(this).children('ul').is(":hidden")) {
$(this).children('ul').slideDown("fast");
}
else {
$(this).children('ul').slideUp("fast");
}
});
</script>