Here my html :
<ul id="navLeft">
<li>
<a class="nav_a">aaaa</a>
<ul class="children">
<li><a>1111</a></li>
<li><a>1111</a></li>
<li><a>1111</a></li>
</ul>
</li>
<li>
<a class="nav_a">bbbb</a>
<ul class="children">
<li><a>2222</a></li>
<li><a>2222</a></li>
<li><a>2222</a></li>
</ul>
</li>
<li>
<a class="nav_a">cccc</a>
<ul class="children">
<li><a>3333</a></li>
<li><a>3333</a></li>
<li><a>3333</a></li>
</ul>
</li>
</ul>
</body>
CSS:
.children{
display: none;
}
jquery:
$(".nav_a").click(function () {
$('ul.children').not($(this).next('ul.children')).removeClass("expanded").slideUp();
$(this).next('ul.children').toggleClass("expanded").slideToggle(250);
});
4
Answers
I hope this css is what you are looking for. If this is not working Please give a detailed description.
Can you please Check the below script instead of your script and tell me this is what you are looking for.
If this is what you are trying to acheive then don’t forget to mark it as a correct answer.
Try the above script instead of the script You are using