I have the following javascript which i use for a mobile menu which works ok but when a submenu item that has another sub menu is clicked it doesnt only close that sub menu but it also closes the parent sub menu. Hope that makes sense. Any ideas on how to get it to just close that sub menu and not the parent sub menu ?
jQuery('.mobile-menu .sub-menu').hide();
jQuery(document).ready(function () {
jQuery('.mobile-menu .sub-menu').parent().find('a:first').removeAttr('href').css('cursor','default');
if (jQuery('.mobile-menu .menu-item-has-children').length > 0) {
jQuery('.mobile-menu .menu-item-has-children').click(
function (event) {
jQuery(this).addClass('toggled')
if (jQuery(this).hasClass('toggled')) {
jQuery(this).children('ul').toggle();
}
});
}
});