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: Vertically aligning navigation stops dropdowns working

Home Forums Older releases 1.0.x + Bootstrap addon Vertically aligning navigation stops dropdowns working Reply To: Vertically aligning navigation stops dropdowns working

#3414
admin
Keymaster

That’s because the Bootstrap addon depends on the default Bootstrap’s float: left/right declaration for the LI elements to detect when the menu tree is in collapsible mode. So you will need to modify the following code in “jquery.smartmenus.bootstrap.js”:

					// custom "isCollapsible" method for Bootstrap
					obj.isCollapsible = function() {
						return !/^(left|right)$/.test(this.$firstLink.parent().css('float'));
					};

like this:

					// custom "isCollapsible" method for Bootstrap
					obj.isCollapsible = function() {
						return this.$firstLink.parent().css('display') == 'block';
					};

And also make sure your CSS only affects desktop view:

@media (min-width: 768px) {
	.navbar-default .navbar-nav > li {
		float: none;
		display: table-cell;
		vertical-align: middle;
		text-align: center;
	}
}