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.

href not working on parent as expected

Home Forums Older releases 1.0.x href not working on parent as expected

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #3019

    Hello I have the following structure:

    <pre><ul id="main-menu" class="sm sm-blue">
      <li><a href="#">Item 1</a></li>
      <li><a href="#">Item 2</a>
          <li><a href="#">Item 2-1</a></li>
          <li><a href="#">Item 2-2</a></li>
          <li><a href="#">Item 2-3</a></li>
      <li><a href="#">Item 3</a></li>

    Now when I click Item 2 the tree is expanding as expected. But the href of item 2 does not fire. By clicking item 2 a second time href is firing. How can i let it fire the first time I click it (while it expands)?


    Here is some sample code that will make the main menu links load on first click/tap in mobile view:

    $(function() {
    	var $mainMenu = $('#main-menu');
    	// don't show the sub menus in collapsible mode unless the sub arrow is clicked
    	$mainMenu.on('click', 'span.sub-arrow', function(e) {
    			var obj = $'smartmenus');
    			if (obj.isCollapsible()) {
    				var $item = $(this).parent(),
    					$sub = $item.closest('li').dataSM('sub');
    				$sub.dataSM('arrowClicked', true);
    			'beforeshow.smapi': function(e, menu) {
    				var obj = $'smartmenus');
    				if (obj.isCollapsible()) {
    					var $menu = $(menu);
    					if (!$menu.dataSM('arrowClicked')) {
    						return false;

    Please let me know if you have any troubles.



    works great!!!

    Still I have a bit thinking to do.
    As I work on a CMS that the user allows to choose the menuposition (left, horizontal maybe multiple menus) I have to check it out deeper.
    In the left-menu in desktop-mode I want the menu stay expanded and active.
    On mobile view the menu should disapear after the selection.

    Your code will help me and point the direction.



    I come back with this issue. As mentioned it works but still does not cover my reqirements.

    I tried to change the script you provided but failed.

    The menu should react as this examlple (click the CMS_ML -item of the link :
    – on click the menu should expand and the href should fire and the menu should remain expaded.
    – on cklick of the sub-menu the href should fire and the menu should remain expanded.

    Is there an easy way to do this?


    i think there might be the need of a new style (sm-vertical-no-flyout) as mobile-view should act as it is?!


    that script not working for multiple instance

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