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.

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1401
    alexis
    Participant

    Hi there,

    love this navigation as it covers just what I need – thanks a lot. I have a vertical menu (< 1200px viewport), which I wanted to be opened displaying the current link same as here http://www.smartmenus.org/forums/topic/vertical-menu-expanded-on-page-load

    I guess I missed something, it doesn't open on page load.

    live example is http://zeta.cleanwells.de/2_3-regenerierung.html

    Thank you!

    #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!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘0.9.x’ is closed to new topics and replies.