Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Re: Do not show submenus on parent item click

Home Forums Older releases 0.9.x Do not show submenus on parent item click Re: Do not show submenus on parent item click

#1654
admin
Keymaster

Hi,

As far as I understand, you have a collapsible sidebar menu for both desktop and mobile, so you could achieve it, for example, like this:

$('#side-menu').smartmenus({
	mainMenuSubOffsetX: 1,
	mainMenuSubOffsetY: -8,
	subMenusSubOffsetX: 1
});

// collapse the submenus of the current selected menu item
$('#side-menu').smartmenus('itemActivate', $('a.current'));

// disable showing/hiding any sub menus
$('#side-menu').bind('beforeshow.smapi beforehide.smapi', function() {
	return false;
});

Please let me know if you need any further tweaks.

Cheers!