• Resolved sonissg83

    (@sonissg83)


    Good! I have on this website the collapsible menu on mobile worked fine. Suddenly it stopped working on mobile. The page is a landing, and the menu anchors to that same page. The problem is that now when clicked, it takes you to where you need to anchor but the menu doesn’t close! You can try it at sanitotal.cl

    I already tried deleting and re-assembling the menu.

    The template is Uncode. If you help me solve it, I would appreciate it!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author malihu

    (@malihu)

    Hi,

    The functionality of closing the mobile menu when navigating through sections of the same page, is not coming from the plugin (it comes from your theme).
    For instance right now, you don’t have “Page scroll to id” activated and your mobile menu still stays open after you’ve clicked the links.

    In order to do what you describe (i.e. auto-close the mobile menu when the links are clicked), you need to add an extra script in your page/template.

    I have a dedicated page describing the solution for such issue here:

    http://manos.malihu.gr/how-to-close-mobile-menu-with-page-scroll-to-id/

    So, you basically need to:

    1) Activate “Page scroll to id”.

    2) Following the instructions here, add the following script:

    <script>
    (function($){
        $(window).on("load",function(){
            $(document).on("click",".menu-primary .menu-item ._mPS2id-h",function(){
                $(".mobile-menu-button").trigger("click");
            });
        });
    })(jQuery);
    </script>

    Let me know

    Thread Starter sonissg83

    (@sonissg83)

    Yes! thank you! I just changed the names of the classes that were not correct, and it works perfect!

    Really thank you very much for your help. I’m a designer and I couldn’t have solved it alone.

    Plugin Author malihu

    (@malihu)

    You’re welcome 🙂

    Same problem, i’ve add the code and change the classes but does not work, menu dont collapse

    the website is marcotermine.it

    ive add this code:

    <script>
    (function($){
        $(window).on("load",function(){
            $(document).on("click",".offcanvas-menu-wrap .menu-item ._mPS2id-h",function(){
                $(".kfi.kfi-close-alt2").trigger("click");
            });
        });
    })(jQuery);
    </script>

    maybe i write the wrong classes?

    thanks for your help

    • This reply was modified 3 years, 11 months ago by DevilIce.
    • This reply was modified 3 years, 11 months ago by DevilIce.
    • This reply was modified 3 years, 11 months ago by DevilIce.
    Plugin Author malihu

    (@malihu)

    @devilice Try this:

    (function($){
        $(window).on("load",function(){
            $(document).on("click","#offcanvas-menu .menu-item ._mPS2id-h",function(){
                $(".kfi.kfi-close-alt2").trigger("click");
            });
        });
    })(jQuery);

    already tried with that code but without the #

    now work!
    the problem was the #

    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page scroll to ID menu item not collapsing the menu on mobile’ is closed to new replies.