1
I have the following menu it is vertical what I want to do and when I click on the link with the class j_open a ul with the class j_open_ul have a display block using the effect . toggle the problem and that when I click on one it opens to two ul with the class j_open_ul what I want and when I click on one it open the corresponding ul and close the other open .
<script type="text/javascript">
$('.j_open').on('click', function(e) {
e.preventDefault();
$(this).closest('ul').find('.j_open_ul').slideToggle('slow');
});
</script>
<li class="dashboard_nav_menu_li">
<a class= j_open">teste</a>
<ul class="dashboard_nav_menu_sub j_open_ul">
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 1</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 2</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 3</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 4</a></li>
</ul>
</li>
<li class="dashboard_nav_menu_li">
<a class= j_open">teste</a>
<ul class="dashboard_nav_menu_sub j_open_ul">
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 5</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 6</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 7</a></li>
<li class="dashboard_nav_menu_sub_li"><a href="#">Link 8</a></li>
</ul>
</li>
thanks for the answer which is the best way when I click on the link 1 it open and when clicking on the link 2 close the 1 and vice versa.
– diogo Dsa
I made another code by clicking on one opening the other!
– LeAndrade