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!

Register

You will be emailed a link to set your password.

Login

Lost password?