Hello everyone! I fight with the menu code-accordion, but I can’t make the parent link active. The submenu opens, but I would like the parent link to work as well. I give the code:

PHP code

<ul class="showHide"> <li><?php $categories = get_cat1(); foreach($categories as $item): ?> <a class="headli" href="index.php?view=cat&id=<?=$item['cat_id'];?>"><span><?=$item['name'];?></span> <?php endforeach;?> </a> <ul > <li> <?php $categories = get_cat4(); foreach($categories as $item): ?> <a href="index.php?view=cat&id=<?=$item['cat_id'];?>"><span><?=$item['name'];?></span> <?php endforeach;?> </a></li> <li> <?php $categories = get_cat5(); foreach($categories as $item): ?> <a href="index.php?view=cat&id=<?=$item['cat_id'];?>"><span><?=$item['name'];?></span> <?php endforeach;?> </a></li> <li><?php $categories = get_cat6(); foreach($categories as $item): ?> <a href="index.php?view=cat&id=<?=$item['cat_id'];?>"><span><?=$item['name'];?></span> <?php endforeach;?> </a></li> </ul> </li> </ul> 

Javascript code

 $(document).ready(function(){ var openItem = false; if($.cookie("openItem") && $.cookie("openItem") != 'false'){ var openItem = parseInt($.cookie("openItem")); } $(".showHide").accordion ({ active: openItem, collapsible: true, autoHeight: false }); $(".showHide .headli").click(function(){ $.cookie("openItem", $(".showHide").accordion("option", "active") ,{expires: 7, path: "/" }); }); }); 

I tried to insert navigation: true, but nothing happens ........

What you need to change, insert?

Thank you in advance!

  • Good people, absolutely nothing ..... ???? - arhat78
  • No one can tell .... Sorry ... - arhat78

0