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.

showOnClick option for the second-level sub menus

Home Forums Older releases 0.9.x showOnClick option for the second-level sub menus

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1390
    ron13315
    Participant

    Hello there, please let me know how can I apply the showOnClick on the second-level sub menus.

    #1732
    admin
    Keymaster

    Hi sorry for the delay! I was on a vacation.

    By default the showOnClick: true option makes the menu tree behave like OS desktop menus where a click activates the tree and then the sub menus are activated immediately on hover. So you would need some sort of mod. The simplest one I can think of is to add the following code on your page after the SmartMenus jQuery code:

    	// always emulate touch mode
    	$.SmartMenus.prototype.isTouchMode = function() {
    		return true;
    	};

    This would emulate touch mode even when mouse input is available and thus make sure any sub menu is only activated on tap/click.

    #1748
    Elizabeth_Keen
    Participant

    In this example you hide all the and show the which is it’s sibling, which would ultimately hide the first level of the li and show the second. HTML

    • first

        back

      • Second layer Menu 1
      • Second layer Menu 1
      • Second layer Menu 1
      • Second layer Menu 1

    CSS:

    .second-layer{
    display: none;
    }

    .hide a{
    display: none;
    }

    .show a{
    display: none;
    }

    .show a.back{
    display:block;
    }

    .show .second-layer{
    display: block;
    }

    JQuery:

    $(‘.forward’).click(function(){
    $(this).parent().addClass(‘show’);
    $(this).parent().parent().addClass(‘hide’);
    });

    $(‘.back’).click(function(){
    $(this).parent().parent().removeClass(‘show’);
    $(this).parent().parent().parent().removeClass(‘hide’);
    });

    For innovative methodologies in Web Apps visit http://www.ati-erp.com

    #8372
    hmartens
    Participant

    I have an issue at the moment where on menu I click a submenu and it dropsdown correctly, but when I click again it goes to the parent link or refreshes the page if my link is # on the parent dropdown.

    When I add the showOnClick true option, I can click on the link and it drops down..but when I click again on it it does nothing, it does not minimise the dropdown…it does nothing

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