Re: How to disable/enable only one sub menu?

Home Forums Older releases 0.9.x How to disable/enable only one sub menu? Re: How to disable/enable only one sub menu?

#1696
admin
Keymaster

OK, there is no available method for this, but you could achieve it, for example, with some custom functions like these:

function disableItem($parentLI) {
	$parentLI.on('mouseenter.smartmenus mouseleave.smartmenus mousedown.smartmenus focus.smartmenus blur.smartmenus click.smartmenus touchend.smartmenus', 'a', function(e) {
		e.stopPropagation();
		e.preventDefault();
	});
}

function enableItem($parentLI) {
	$parentLI.off('mouseenter.smartmenus mouseleave.smartmenus mousedown.smartmenus focus.smartmenus blur.smartmenus click.smartmenus touchend.smartmenus');
}

When calling any of these you will need to pass the item’s LI element as an argument. For example, if you have the following HTML:

...
<li id="myParentItem"><a>Menu 2 </a>
	<ul>...</ul>
</li>
...

you could use the following JS to disable/enable the item (and its sub menu):

disableItem($('#myParentItem'));
enableItem($('#myParentItem'));

Register

You will be emailed a link to set your password.

Login

Lost password?