Re: Collapse mobile menu on menu click

Home Forums Older releases 0.9.x Collapse mobile menu on menu click Re: Collapse mobile menu on menu click

#1673
admin
Keymaster

You can achieve it like this – open “jquery.smartmenus.bootstrap.js” and find the following lines:

			.bind({
				// set/unset proper Bootstrap classes for some menu elements
				...

Then change them like this:

			.bind({
				'select.smapi': function(e, item) {
					var $this = $(this),
						obj = $this.data('smartmenus');
					if (obj.isCollapsible()) {
						$this.closest('.navbar').find('button.navbar-toggle').click();
					}
				},
				// set/unset proper Bootstrap classes for some menu elements
				...

This will make sure each time a menu item is selected a click is simulated on the navbar toggle button which would collapse the navbar.

Register

You will be emailed a link to set your password.

Login

Lost password?