Mobile Menu Close on Click

12 replies · opened Jul 3, 2021

SSemicolon WebSTAFFJul 3, 2021

Hello,

Currently, the Mobile Menu functionality works like this with Canvas v6:

  • If the User clicks on the Menu Arrow, it will open or close the Sub-Menu.

  • If the User clicks on the Parent Menu Item and there is a Link assigned to the Parent Menu Item, it will proceed to the Link and not open the Sub-Menu.

  • If the User clicks on the Parent Menu Item and there is no Link assigned to the Parent Menu Item, it will open the Sub-Menu.

So to Open/Close the Sub Menus, currently only the Menu Trigger (Arrow) can be used.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

TtautraJul 3, 2021

Hello, so there is not possible anymore that the menu closes after it is scrolled to within the page. See attached.

SSemicolon WebSTAFFJul 3, 2021

The Closing of the Mobile Menus after scrolling on the Page works fine and is not removed in v6. You can check the Live Preview here: http://themes.semicolonweb.com/html/canvas/op-index.html .

The issue with your Codes is that you are using data-scrollto for the In-Page Scroll Links which does support the Sub-Menu closing functionality. Sub-Menu closing is supported but only when .one-page-menu Class is added to the Menu Container and data-scrollto is changed to data-href. Simply checkout the Default Codes provided in the op-index.html File and make the changes accordingly.

This should definitely start working then. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFJul 5, 2021

Consider adding the .one-page-menu Class to the .menu-container Element as this is required for the One Page scroll to work and then update the js/plugins.min.js File with the one attached to this reply.

This should definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFJul 5, 2021

You have added both js/plugins.js and js/plugins.min.js Files (see attached) which is causing conflicts. Please make sure that you are using only one of them. Make these changes and try checking this again. We have checked the Codes completely before sending them to you and it is working perfectly fine for us in the Default Package Files.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

TtautraJul 5, 2021

On the live page (before upgrading to V6), I used this script to get the menu to close... https://www.sonnenberg-ag.ch/am.html

<!-- Close on click
============================================= -->

&lt;script&gt;
jQuery(document).on('click', function(event) {
    if (!jQuery(event.target).closest('#primary-menu').length) {
        if( jQuery('#primary-menu').find('ul.mobile-primary-menu').length &gt; 0 ) {
            jQuery( '#primary-menu &gt; ul.mobile-primary-menu, #primary-menu &gt; div &gt; ul.mobile-primary-menu' ).toggleClass("show", false);
        } else {
            jQuery( '#primary-menu &gt; ul, #primary-menu &gt; div &gt; ul' ).toggleClass("show", false);
        }
        jQuery('body').toggleClass("primary-menu-open", false);
    }
});

</script>

SSemicolon WebSTAFFJul 5, 2021

We have incorporated the Codes for you in the updated js/plugins.min.js File which we had provided you earlier but when we checked this page: https://www.sonnenberg-ag.ch/el/am1.html, the error with the js/plugins.min.js File is that you have not completely download and updated the file. Make sure that you Download this File and then replace it with the Default js/plugins.min.js File.

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

TtautraJul 5, 2021

Yes. It works now! Many thanks.

SSemicolon WebSTAFFJul 5, 2021

Glad the issue was resolved!

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard