Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #636643

    Hi,

    I have the mobile menu enabled on smartphones and tablets as I have quite an extensive navigation.

    I would like the menu to only display the top level items on initial load and so I have checked the box so that a user needs to click on the parent menu for the sub-menus to be shown. However, in doing so, it’s actually not then possible to navigate to the parent menu.

    Am I missing something? If I could set a separate mobile menu I would try and work around it by adding the parent menu into the sub-menu as well but I don’t want this also appearing on desktop.

    Is there some way of being able to expand the navigation and still be able to click on the parent menu to reach those pages?

    Cheers,
    Marsha

    #637296

    Hey Marsha,

    Thank you for using Enfold.

    This is the default behaviour of the parent menu item when you hide the sub menu items. We can add a link beside the “parent menu item” but I’m not sure if you will like it. Add this in the functions.php file:

    // add go to link
    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
    	var $html = $('html');
    
    	$('#mobile-advanced .menu-item-has-children.menu-item-top-level > a').each(function() {
    		$(this).append('<span class="mega-goto-link">Go to this page</a>');
    	});
    
    	$html.on('click', '.mega-goto-link', function() {
    		var href = $('.mega-goto-link').parent('a').attr('href');
    		window.location.href = href;
    	});
    })(jQuery);
    </script>
    <?php
    }

    And the following code in the Quick CSS field:

    .mega-goto-link {
    font-size: 11px;
    position: absolute;
    right: 50px;
    cursor: pointer;
    }
    
    @media only screen and (min-width: 989px) {
      .mega-goto-link {
        display: none;
      }
    }

    Best regards,
    Ismael

    #661836

    Hi – I just tried this solution and nothing is different – no link is added. Link to site posted in private.

    #662972

    Hi,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    Login credentials include:

    • The URL to the login screen.
    • A valid username (with full administration capabilities).
    • As well as a password for that username.
    • permission to deactivate plugins if necessary.

    Best regards,
    Andy

    #663655

    Have supplied below

    #665551

    Hi,

    We modified the code a bit. Please check it now.

    Best regards,
    Ismael

    #837395
    This reply has been marked as private.
    #837713

    Hi,


    @702arts
    : Please go to the Enfold > Main Menu > Burger/Mobile Menu panel then set the “Menu Icon Submenu items” settings to the first option. This will display every menu items including the sub items.

    Best regards,
    Ismael

    #846141
    This reply has been marked as private.
    #846144

    I have discovered that when I check the box (use mega menu) it displays the mega menu on the website but not on the mobile site. When I turn off mega menu or un-check (use mega menu) in appearance>menu then it displays on mobile but does not display mega menu on the website menu bar. I want to display mega menu on the browser and have all the menu items display on mobile. It’s funny how some of the menu sub menu items don’t display while others do.

    Brad

    #846166

    Regarding mega menu’s and mobile it might be related to some of the recent changes. There’s a link with updated JS (while we wait for 4.1.3) in the thread https://kriesi.at/support/topic/sub-menu-do-not-appear-in-mobile-menu-since-4-1/

    #846755

    Hi,

    Yes, it is. Please make sure that the mega menu columns are not empty. They need to contain at least one sub menu item. If you’re still having issue with it, please create a new thread. We’ll check it there.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Mobile Menu – links’ is closed to new replies.