[Resolved] GeneratePress Dropdown Menus are slow – anyway to speed them up?

Home Forums Support [Resolved] GeneratePress Dropdown Menus are slow – anyway to speed them up?

Home Forums Support GeneratePress Dropdown Menus are slow – anyway to speed them up?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #329203
    marianco

    Dear Tom,

    I love GeneratePress.

    But one thing that bugs me is that when I hover to a navigation menu item which has a chevron – indicating the existence of a drop-down submenu – there is an approximately 0.2 to 0.5 second delay before the drop-down submenu appears.

    This makes using GeneratePress’s menus feel really sluggish.

    This is the only thing slow about GeneratePress.

    I would rather have the submenu pop and appear instantly.

    I see the sluggishness in all of the showcased sites that use native GeneratePress navigation menus.

    Recent examples from the showcased sites:
    https://vigosoftware.com
    https://www.blt-avocat-nantes.fr
    http://www.lazzarilucchini.com/category/approfondimenti/

    It is even slow on my local machine with an SSD.

    As an example of submenu’s which pop and appear instantly, look at Thrive Theme’s Rise Theme:
    http://demo.thrivethemes.com/tt/?theme=Rise

    When you hover over the [Blog], [Landing Pages], or [Short Codes] menu items, the submenu pops open instantaneously. There is pleasure in experiencing this speed of navigation.

    So is there something that we can do to instantaneously show the submenu when hovering over a menu item?

    #329247
    Jamal

    Hi

    Would you mind giving this a try and see if it works for you?

    https://generatepress.com/forums/topic/drop-down-menu-speed/#post-164348

    #329326
    marianco

    Thanks Jamal.

    Shock.

    I think this is a User Interface flaw that is deliberately introduced into GeneratePress as a feature. It should be stripped out.

    I was looking for options instead of GeneratePress if this flaw could not be resolved.

    It makes the submenus drop down slower so that the user thinks something is wrong with your website, your coding, your server, etc. It is a huge turnoff to using a GeneratePress website.

    Why make the User Interface slower? That makes no sense. At the very least, at least make it an option in customizer. I bet every web developer will turn this feature off.

    These days, with users expecting a speedy website and with Google ranking your site based on page-load speeds, it makes no sense to slow down the user interface of your website. It makes it feel as if the menus are stuck in mud. Users expect a fast website, not a slow one.

    ————————-

    SOLUTION [Thanks Tom]:

    Remove the flaw by adding the following script to the wp_head hook area of GeneratePress.

    <script>
        jQuery( window ).load( function() {
            jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu.destroy();
            jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu({
                    transition_speed: 0,
    		open_delay: 0,
    		close_delay: 0
            });
        });
    </script>

    I suppose the users of the free version of GeneratePress have to convert this to PHP and add it to their child theme’s custom.php file.

    #329338
    sjoerd89

    Hey Jamal,

    sorry to join in on this thread but i wanted the same thing as Marianco. The script worked for me on the opening speed. But i would like to have some delay for when people go of the navigation with their mouse (could be on accident). So i tried changing the close delay but that does not seem to do anything for me.

    This is the script i used wich i placed in footer.php of my child theme.

    <script>
        jQuery( window ).load( function() {
            jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu.destroy();
            jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu({
                    transition_speed: 0,
    		open_delay: 0,
    		close_delay: 10.0
            });
        });
    </script>

    -edit-
    tried placing it in wp_head hook with the same effect. Opening works, close delay does not.

    #329360
    Jamal

    @sjoerd89 Sorry that’s too advanced for me but Im sure Tom will have an answer for you. In the meantime, can you try close_delay: 10,


    @marianco
    Forgive me as i know its not my place to comment on this but don’t you think you are being a bit harsh? Thousands of us use the drop-down as is without any problems and for anybody who likes a faster speed Tom has provided an answer already in the forums. Just my 2 cents, don’t take it personal 🙂

    #329383
    Tom
    Lead Developer
    Lead Developer

    This is actually a thing called hoverIntent. It’s there to prevent sub-menus from popping open all over the place as you move your mouse over elements on the page quickly (but don’t intend to click/make them open).

    This way, the sub-menus will only open when it’s obvious you intend to open them.

    So far, I remember maybe 3 people wanting to use this script to alter the behavior, so I’m not sure I would call it a flaw in the theme – likely just a preference that some people have.

    Thanks!

    #329696
    marianco

    This is actually a thing called hoverIntent. It’s there to prevent sub-menus from popping open all over the place as you move your mouse over elements on the page quickly (but don’t intend to click/make them open).

    I don’t think popping open all over the place is not a problem when it occurs surely and quickly. It gives you a better feel of the navigation options.

    It would have been nice to add a feature for GeneratePress Premium to make this optional. Call it “Menu Properties”. The features would be:
    1. Hover to show submenu or click to show submenu
    2. Delay before showing menu

    Or add this customization to the Customizer.

    My objection was the slowness it creates for the user interaction that many don’t object to but I do since I prefer a speedy interface. Computers are slow enough as it is.

    My second objection is that I have to insert code to undo this feature when it should have been an option.

    But now that I know I can undo this feature, I’m happier.

    Thanks, Tom.

    #329717
    Tom
    Lead Developer
    Lead Developer

    Appreciate your input – thanks! 🙂

    #331735
    Jay Martin

    In the provided fix for speeding things up, the code utilizes jQuery( window ).load(). I was wondering why this event was used as opposed to jQuery( document ).ready()?

    #331793
    Tom
    Lead Developer
    Lead Developer

    It just waits a little longer until everything is loaded. You could likely get away with document.ready 🙂

    #441842
    Tom
    Lead Developer
    Lead Developer

    Just a heads up that this jQuery function has been removed in GP 2.0 (being released this week).

    The sub-menu uses CSS now, so it’s easier to adjust. Here’s an example: https://generatepress.com/forums/topic/disable-menu-animation-on-hover/#post-436051

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