javascript - Onclick menu simultaneously shows its submenu and load its link without hiding the submenu -


it js menu. used in joomla template. shows , hides submenu , changes clicked menu class active, didn't load content of clicked menu.

var menu_ul = jquery('.menu > li > ul > li > ul'), menu_a  = jquery('.menu > li > ul > li > a');  menu_ul.hide();  menu_a.click(function(e) { e.preventdefault();     if(!jquery(this).hasclass('active')) {          menu_a.removeclass('active');         menu_ul.filter(':visible').slideup('normal');         jquery(this).addclass('active').next().stop(true,true).slidedown('normal');     } else {         jquery(this).removeclass('active');         jquery(this).next().stop(true,true).slideup('normal');     } }); 


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -