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: Hide desktop sub menu on click

Home Forums Older releases 0.9.x Hide desktop sub menu on click Re: Hide desktop sub menu on click

#1763
admin
Keymaster

Hi, you can use the following API tweak:

$('#main-menu').bind('click.smapi', function(e, item) {
	var $item = $(item),
		level = $item.parent().parent().dataSM('level'),
		$sub = $item.parent().dataSM('sub');
	if (level == 1 && $sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
		$(this).smartmenus('menuHideAll');
		return false;
	}
});

Let me know if you still have any troubles.

Cheers!