• Resolved troxx

    (@troxx)


    Hello, standard behavior of the mobile menu is: when you click a menu link to another page – mobile menu disappears. But when this link is only an anchor (one page, jump to section ID) – mobile menu stays and you have to close it manually. How can I force mobile menu to close automatically, after clicking an anchor menu link?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • hannah

    (@hannahritner)

    Hey,
    Try pasting this into a text widget in your footer:

    <script type="text/javascript">
    jQuery(document).ready(function ($) {
    $('.kad-mobile-nav .kad-nav-inner li a').click(function(){
        $('.kad-nav-collapse').collapse('hide');
    });
    });
    </script>

    Let me know how that works for you!

    Hannah

    Thread Starter troxx

    (@troxx)

    Unfortunately, it doesn’t work. Are you sure the class name are correct? This is begginning of the mobile menu raw code:

    <div class="mag-pop-sldr mfp-with-anim kt-mobile-menu" id="kt-mobile-menu" tabindex="-1" role="dialog" aria-hidden="true">
    	            <div class="pop-modal-content">
    	                <div class="pop-modal-body">
                        <ul id="menu-glowne-2" class="kad-mobile-nav"><li class="menu-home menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-63 current_page_item menu-item-147"><a href="https://www.restro.pl/">Home</a></li>
    <li class="menu-mezze menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-148"><a href="https://www.restro.pl/#mezze">Mezze</a></li>
    </ul>	                </div>
    	            </div>
    	        </div>

    Hey,
    The premium theme has this functionality built in with the smooth scroll.

    Here is the javascript (Hannahs was for a different theme):

    <script>
    	jQuery(document).ready(function ($) {
    $('.kt-mobile-menu a').click(function(){
    var magnificPopup = $.magnificPopup.instance;
    magnificPopup.close(); 
    		});
    	});
    </script>

    Ben

    Thread Starter troxx

    (@troxx)

    It works! Thank you, Ben! You did a great job producing Ascend theme, even in free version it’s a powerful tool.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mobile menu doesn’t close after anchor jump to #secton’ is closed to new replies.