Wednesday, 15 May 2013

jquery - Wordpress collapsing menu keeps not expanded -



jquery - Wordpress collapsing menu keeps not expanded -

currently i'm working on site: goo.gl/nud31r

the problem submenu keeps not expanded after clicking on links.

this code is, of course, placed in header.php

<script> $(document).ready(function(){ $('.menu .dropdown a').click(function(e){ if ($(this).parent().children('.sub-menu').is(':visible')) { $(this).parent().children('.sub-menu').toggle(); } else { $(this).parent().children('.sub-menu').toggle(); } }); }); </script>

i guess it's little thing , appreciate help! thanks!

if want sub menu expand after clicking , after page changes need toggle on doc.ready instead of on click.

$(document).ready(function() { $("li.current-menu-item").closest(".sub-menu").toggle(); });

jquery wordpress menu

No comments:

Post a Comment