i have menu called css menu.
when click onto link want close popups open without main menu.
i have found examples, not working me.
$('#cssmenu a').on('click', function() { if ($(this).find('ul').is(':visible')) { // close menus } });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div id='cssmenu'> <ul> <div id='menuspace'></div> <li><a href='/0/wall/' class='ajaxtrigger'><span>home</span></a> </li>" <li class='active has-sub'><a href='#'><span>media</span></a>" <ul> <li class=''> <a href='/0/youtube/' class='ajaxtrigger'> <span>youtube</span> </a> </li> <li class=''><a href='/0/soundcloud/' class='ajaxtrigger'><span>soundcloud</span></a> </li> <li class=''><a href='/0/mixcloud/' class='ajaxtrigger'><span>mixcloud</span></a> </li> <li class=''><a href='/0/pictures/' class='ajaxtrigger'><span>pictures</span></a> </li> </ul> </li> <li class='active has-sub'><a href='#'><span>about</span></a>" <ul> <li class=''><a href='/0/biography/' class='ajaxtrigger'><span>biography</span></a> </li> <li class=''><a href='/0/discography/' class='ajaxtrigger'><span>discography</span></a> </li> <li class=''><a href='/0/agenda/' class='ajaxtrigger'><span>agenda</span> </a> </li> <li class=''><a href='/0/releases/' class='ajaxtrigger'><span>releases</span></a> </li> </ul> </li> <li class='last'><a href='/0/contact' class='ajaxtrigger'><span>contact</span></a> </li> </ul> </div>
this can you! http://jsfiddle.net/lxf2dltl/
$('#cssmenu a').on('click', function(e){ e.preventdefault(); $('#cssmenu ul ul').hide(); $(this).next().show(); });
Comments
Post a Comment