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.

Re: Multilevel Menu width

Home Forums Older releases 0.9.x Multilevel Menu width Re: Multilevel Menu width

#1778
admin
Keymaster

Hi, you will need to override the default options which are:

subMenusMinWidth: '10em',	// min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored
subMenusMaxWidth: '20em',	// max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored

To do this, you need to edit the following in “jquery.smartmenus.bootstrap.js”:

		$this.addClass('sm').smartmenus({

						// these are some good default options that should work for all
						// you can, of course, tweak these as you like
						subMenusSubOffsetX: 2,
						subMenusSubOffsetY: -6,
						subIndicatorsPos: 'append',
						subIndicatorsText: '...',
						collapsibleShowFunction: null,
						collapsibleHideFunction: null,
						rightToLeftSubMenus: $this.hasClass('navbar-right'),
						bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
		})

and pass the subMenusMaxWidth option with a desired value (could be even '' if you don’t want any max-width constraint):

		$this.addClass('sm').smartmenus({

						subMenusMaxWidth: '30em',
						// these are some good default options that should work for all
						// you can, of course, tweak these as you like
						subMenusSubOffsetX: 2,
						subMenusSubOffsetY: -6,
						subIndicatorsPos: 'append',
						subIndicatorsText: '...',
						collapsibleShowFunction: null,
						collapsibleHideFunction: null,
						rightToLeftSubMenus: $this.hasClass('navbar-right'),
						bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
		})

Let me know if you still have any troubles.