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: Automatically close sub menus when opening other sub menus

Home Forums Older releases 1.0.x Automatically close sub menus when opening other sub menus Reply To: Automatically close sub menus when opening other sub menus

#2780
admin
Keymaster

OK, here is the demo:

http://jsfiddle.net/9xtnk2zc/1/

You will need the jQuery scrollTo plugin for the scrolling and then just use a custom collapsibleShowFunction when you initialise the SmartMenus plugin:

	// custom function to auto scroll to activated parent item in collapsible mode
	collapsibleShowFunction: function($ul, complete) {
		$ul.slideDown(200, function() {
			complete();
			// auto scroll to parent item
			$(window).scrollTo($ul.dataSM('parent-a'), 500);
		});
	}

Cheers!