Welcome Guest, Not a member yet? Register   Sign In
JS Function For Menu Codeigniter
#1

[eluser]razerone[/eluser]
Hi I am making menu for codeigniter.

Just about there just stuck on small issue.

I need to be able to make the parent category when click on it to show then if click on it again to hide.

At the moment I have only got it working for so parent cat opens when click. Just need to have second option so can click on parent again after it opens it click it will close

$('.nav-show').hide();

$("li:has(ul)").click(function(){

$("ul",this).slideDown();
});


<div class="container">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
<div class="sidebar">
<ul class="nav sidenav">
<li><a href="#">Home</a></li>
<li><a href="#">Download Software</a></li>
<li>
<a href="#">Features</a>
<ul class="nav nav-show">
<li><a href="#">Font Page Database</a></li>
<li><a href="#">TPL Links</a></li>
<li><a href="#">Custom Contact Page</a></li>
</ul>
</li>
<li><a href="#">Custom Modules</a></li>
<li><a href="#">CWS User Guide</a></li>
<li>
<a href="#">CWS HMVC Codeigniter</a>
<ul class="nav nav-show">
<li><a href="#">Modules</a></li>
<li><a href="#">TPL Links</a></li>
<li><a href="#">Custom Contact Page</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
#2

[eluser]Tpojka[/eluser]
Check jquery site/forums, but you can also try with toggle() function.




Theme © iAndrew 2016 - Forum software by © MyBB