[Resolved] Sticky mobile menu does´t work

Home Forums Support [Resolved] Sticky mobile menu does´t work

Home Forums Support Sticky mobile menu does´t work

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #218518
    Miguel

    My sticky mobile menu doesn´t display categories after scrolling the page if I click in the Menu button.
    http://www.elblogdemiguel.com

    #218606
    Leo
    Staff
    Customer Support

    Hello,

    Can you try #1 on this page? https://generatepress.com/knowledgebase/debugging/
    Also noticed that right click does not work on your page as well.

    #218803
    Miguel

    If I try the #1 of that page, I’m still having the same problem.

    #218897
    Tom
    Lead Developer
    Lead Developer

    You’re using an old version of GP Premium, can you update to the latest?: https://generatepress.com/knowledgebase/updating-add-ons/#manual-update

    #219128
    Miguel

    Thank you Tom, now works perfectly

    #219213
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #284728
    Henry

    Hi Tom,

    I have come across the same issue. I have tried the troubleshooting steps suggested but have had no luck. I have noticed that when I enable the Mobile Menu and Sticky Mobile Header (via Customize->Layout->Header) the mobile menu shows fine but does not ‘stick’ when I scroll.

    It does work fine when the Mobile Menu is disabled (via Customize->Layout->Header) and Sticky Navigation is enabled (via Customize->Layout->Primary Navigation).

    In dev tools it shows the following errors:

    Uncaught TypeError: jQuery(...).GenerateSimpleSticky is not a function
        at HTMLDocument.<anonymous> (sticky.min.js?ver=1.2.94:1)
        at i (jquery.js?ver=1.12.4:2)
        at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
        at Function.ready (jquery.js?ver=1.12.4:2)
        at HTMLDocument.K (jquery.js?ver=1.12.4:2)

    I have tried it on two sites with same results.
    https://dci.hsnyc.co/
    http://sandbeach.hsnyc.co/

    I am using the latest version of the plugin. Am I missing a step or could this be a bug?

    Your help is appreciated Tom.

    Regards,
    Henry Sanchez

    #284763
    Tom
    Lead Developer
    Lead Developer

    Hmm, it’s saying that jQuery function doesn’t exist, however it’s defined directly above it in the file.

    Any change you can see if there’s a conflicting plugin using #1 on this page?: https://docs.generatepress.com/article/debugging-tips/

    Any caching or minifying plugins?

    #284772
    Henry

    The only plugins that are active are Elementor, Elementor Pro, and GP Premium. When I deactivate both Elementor, Elementor Pro I get the same message.

    Thanks!

    – Henry

    #284778
    Tom
    Lead Developer
    Lead Developer

    Any chance you can send me temporary admin login details? https://generatepress.com/contact/

    #284796
    Henry

    Just sent. Thanks Tom.

    #284844
    Tom
    Lead Developer
    Lead Developer

    Thanks, Henry.

    Duplicated your settings onto my own localhost and the mobile header is sticking.

    Do you have anything your child theme functions.php file?

    #284848
    Henry

    Interesting. I have a few functions on my functions.php file:

    //Custom Scripts
     function custom_scripts() {
    	wp_enqueue_script( 'jquery3', get_stylesheet_directory_uri() . '/js/jquery.min.js', array(), '3.1.1', true );
        wp_enqueue_script( 'scroll', get_stylesheet_directory_uri() . '/js/scroll.js', array(), '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'custom_scripts' );
    
    //Loads the login page css styles
    function custom_login() {
    echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login/login-styles.css" />';
    }
    add_action('login_head', 'custom_login');
    
    //changes the logo url
    function login_logo_url() {
        return 'https://sandbeachllc.com';
    }
    add_filter('login_headerurl', 'login_logo_url');
    
    //changes the logo hover Text
    function login_logo_text() {
        return 'Sandbeach Properties LLC';
    }
    add_filter('login_headertitle', 'login_logo_text');
    /*=== LOGIN Page Funtions End ===*/

    I went ahead and commented all this out and still not able to get it to work 🙁

    Thanks for your help Tom.

    #284849
    Tom
    Lead Developer
    Lead Developer

    This line could definitely cause issues:

    wp_enqueue_script( 'jquery3', get_stylesheet_directory_uri() . '/js/jquery.min.js', array(), '3.1.1', true );

    WP adds jQuery by default, so adding it again can cause compatibility issues.

    I’m still seeing it added to the source of your site – did you un-comment it?

    #285413
    Henry

    That was the issue. Thank you! I have a follow up.. I have a script that scrolls to a section on the same page so when I open the menu and click on a link it will scroll to the section but the mobile menu will not close until you click the ‘x’. Any way to change this behavior so that it closes when you click on the menu item or when you click outside the menu?

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.