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.

Do not show submenus on parent item click

Home Forums Older releases 0.9.x Do not show submenus on parent item click

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1363
    uminfaa
    Participant

    When I click the item that has a sub menu, I do not want to show its sub menus but just want to take me to the target page of that item.

    I only want to display its submenus when I am already in the target page.

    It is working fine if I am using a desktop web browsers (e.g. chrome, IE, firefox) but when I try to view the page on ipad and iphone using safari and chrome I couldnt click the item nor expand the submenus.

    Here is the code I am currently using:

    //Vertical Menu
    $(‘#side-menu’).smartmenus({
    mainMenuSubOffsetX: 1,
    mainMenuSubOffsetY: -8,
    subMenusSubOffsetX: 1,
    hideOnClick: false,
    showOnClick: false,
    showFunction: function($ul, complete) { complete(); }
    });

    //Remove the click event handler to prevent menu from collapsing its submenus
    $(‘#side-menu’).unbind(“click”);

    //collapse the submenus of the current selected menu item
    $(‘#side-menu’).smartmenus(‘itemActivate’, $(‘a.current’));

    I really appreciate any help with this.
    Please help. Thanks!

    #1653
    uminfaa
    Participant

    Also, I tried adding a showOnClick: false but it seems not working and I tried overriding some events but it still showing the submenus when I click the item. 🙁

    #1654
    admin
    Keymaster

    Hi,

    As far as I understand, you have a collapsible sidebar menu for both desktop and mobile, so you could achieve it, for example, like this:

    $('#side-menu').smartmenus({
    	mainMenuSubOffsetX: 1,
    	mainMenuSubOffsetY: -8,
    	subMenusSubOffsetX: 1
    });
    
    // collapse the submenus of the current selected menu item
    $('#side-menu').smartmenus('itemActivate', $('a.current'));
    
    // disable showing/hiding any sub menus
    $('#side-menu').bind('beforeshow.smapi beforehide.smapi', function() {
    	return false;
    });

    Please let me know if you need any further tweaks.

    Cheers!

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