Reply To: How do I drop the entire menu by selecting an item from it?

Home Forums Latest release 1.1.x + Bootstrap 4 addon How do I drop the entire menu by selecting an item from it? Reply To: How do I drop the entire menu by selecting an item from it?

#8303
admin
Keymaster

Hi, you could use something like this:

$(function() {
  // SmartMenus jQuery - collapse mobile navbar on menu item select
  $('.navbar-nav').on('select.smapi', function(e) {
  	if ($(this).hasClass('sm-collapsible')) {
  		$('.navbar-toggler')[0].click();
  	}
  });
});

Just include it on your page after jQuery.

If you have multiple navbars on your pages (not very likely), set them specific ids and replace the classes .navbar-nav and .navbar-toggler in the code above with the proper ids.

Register

You will be emailed a link to set your password.

Login

Lost password?