I've got a nav that has a js sub-menu that drops down on click.
Here's the js code:
// dropdown button
var mainMenuDropdownLink = $('.nav-menu .menu-item-has-children > a, .nav-menu .page_item_has_children > a');
var dropDownArrow = $('<a href="#" class="dropdown-toggle"><span class="screen-reader-text">toggle child menu</span>+</a>');
mainMenuDropdownLink.after(dropDownArrow);
// dropdown open on click
var dropDownButton = mainMenuDropdownLink.next('a.dropdown-toggle');
dropDownButton.on('click', function(e){
e.preventDefault();
var $this = $(this);
$this.parent('li').toggleClass('toggle-on').siblings().removeClass('toggle-on').find('.toggle-on').removeClass('toggle-on');
});
You can see the staging site here. (The html code is pretty messy so I didn't post it here.)
http://local.curesstudio.com/service-type/skincare/
Notice the + plus sign in the nav. That's the dropdown menu. I'd like to make the whole menu activate the dropdown. So clicking on LASHES + BROWS activates the submenu.. Still a noob with js so go easy on me. Thanks.