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.

Reply To: Hiding the dropdown menu at the desktop level only

Home Forums Older releases 1.0.x + Bootstrap addon Hiding the dropdown menu at the desktop level only Reply To: Hiding the dropdown menu at the desktop level only

#2705
admin
Keymaster

Yes, you can do it like this:

$(function() {
	// disable the sub menus in desktop mode
	$('#main-menu').bind('activate.smapi', function(e, item) {
		// only for the li#menu-item-164 item
		if ($(item).parent().is('#menu-item-164')) {
			if (!$(this).data('smartmenus').isCollapsible()) {
				return false;
			}
		}
	});
});

The activate.smapi event is always triggered on the root UL and the item parameter is the menu item’s link (the <a> element).

Cheers!