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)
  • You must be logged in to reply to this topic.

Register

You will be emailed a link to set your password.

Login

Lost password?