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: open current sub menus on page load with itemActivate

Home Forums Older releases 0.9.x open current sub menus on page load with itemActivate Re: open current sub menus on page load with itemActivate

#1813
admin
Keymaster

Hi, glad you like the script!

Just put this line:

$("#main-menu").smartmenus("itemActivate", $("#main-menu").find("a.current").eq( - 1));

inside the domready handler (at the moment it’s after it) along with the SmartMenus init call like this:

$(function() {
	$('#main-menu').smartmenus({
		subMenusSubOffsetX: 1,
		subMenusSubOffsetY: -8,
		markCurrentItem: true,
		markCurrentTree: true,
		hideOnClick: false
	});
	$("#main-menu").smartmenus("itemActivate", $("#main-menu").find("a.current").eq( - 1));
});

and it should work.

Cheers!