• Resolved gkatem96

    (@gkatem96)


    In the mobile version of my website, I have this menu item that links to an anchor-id at the homepage. When I am in the homepage and I click on this menu item one of two things happen:

    1. On Android, without closing the menu, it shows like it’s scrolling, but when I close the menu I’m still at the top. So –> Not scrolling to id & menu not closing.
    2. On Iphone, it scrolls to the id and the menu closes, but the page is then frozen, and I have to hit ‘back’ in order to unfreeze.

    I have the ‘Page scroll to ID’ plugin enabled, since I want smooth scrolling whenever an anchor is selected. If I deactivate the plugin the issue goes away, but it only jumps to that section instead of smooth scrolling to it.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ina

    (@inamoro)

    Hi, @gkatem96

    We checked on our end on both Android and iPhone and the scrolling works fine. In case the issue still persists on your end, please consider clearing the cache of your website and browser(s).

    Thread Starter gkatem96

    (@gkatem96)

    Hello @inamoro, the issue is now fixed as I pasted a function in my functions.php file, as sent by the plugin creator.

    I will leave the function below for anyone facing the same issue in the future as reference:

    function ps2id_custom_script(){
        wp_register_script( 'ps2id-custom-script', '', array('jquery', 'page-scroll-to-id-plugin-script'), '', true );
        wp_enqueue_script( 'ps2id-custom-script' );
        wp_add_inline_script( 'ps2id-custom-script', '(function($){
            $(window).on("load",function(){
                $(document).on("click","#modal-1-content .wp-block-navigation-link ._mPS2id-h",function(){
                    $(".wp-block-navigation__responsive-container-close").trigger("click");
                });
            });
        })(jQuery);');
    }
    add_action( 'wp_enqueue_scripts', 'ps2id_custom_script' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hamburger Menu not working on anchors’ is closed to new replies.