Reply To: Make submenu slide open/close

Home Forums Older releases 1.0.x + Bootstrap addon Make submenu slide open/close Reply To: Make submenu slide open/close

#3443
admin
Keymaster

Yep, as you’ve noticed, by default the addon mimics Bootstrap’s default behavior so the sub menus are not animated in collapsible mode. So, you would need the following options:

collapsibleShowFunction: function($ul, complete) {
	$ul.slideDown(200, complete);
},
collapsibleHideFunction: function($ul, complete) {
	$ul.slideUp(200, function() {
		$ul.parent().removeClass('open');
		complete();
	});
}

And also another small change in “jquery.smartmenus.bootstrap.js” – comment out/remove the following code:

,
'hide.smapi': function(e, menu) {
	$(menu).parent().removeClass('open');
}

Alternatively, if you would like to avoid editing “jquery.smartmenus.bootstrap.js”, you could add the options directly in the HTML source in a data-sm-options attribute:

https://www.smartmenus.org/docs/#data-sm-options

and add the following JS code on your page after the link to “jquery.smartmenus.bootstrap.js”:

$(function() {
	$('ul.navbar-nav:not([data-sm-skip])').unbind('hide.smapi');
});

Cheers!

Register

You will be emailed a link to set your password.

Login

Lost password?