Site logo

[Resolved] Strange bump when scrolling back to top

Home Forums Support [Resolved] Strange bump when scrolling back to top

Home Forums Support Strange bump when scrolling back to top

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2179236
    Annamari

    Hi,

    I tried to search for a similar problem in the forum, but couldn’t find any.

    When I scroll back to top, a strange “bump” happens when the secondary menu changes back to the original header, and I can see two logos at the same time for a second. (URL in the private area.)
    What causes this? How can I get rid of it?

    Thanks,
    Annamari

    #2179288
    Fernando
    Customer Support

    Hi Annamari,

    I can’t seem to replicate the issues you’ve mentioned from my end. The transition from the sticky navigation to the “non-sticky” navigation seems smooth when the back-to-top button is pressed.

    This may potentially be a caching issue. Can you try clearing your browser’s cache? If this doesn’t work, can you try viewing the site from a different browser or device to completely rule out browser caching as the cause of the issue?

    Kindly let us know how it goes. 🙂

    #2180182
    Annamari

    Hi Fernando,

    I checked it in a different browser/device and I can still experience the problem.

    It happens when scrolling back to top manually, more slowly, not with the back-to-top button.

    I’m attaching an image of it in the private area.

    #2180418
    Fernando
    Customer Support

    I see. That’s actually the default behavior/design when Sticky Navigation is used.

    For instance, here is my test site: https://share.getcloudapp.com/8LuDpE7Y

    If you would like an alternative, you can do away with the Sticky navigation and make the navigation fixed instead.

    For instance: https://share.getcloudapp.com/9ZumDOxv

    To do this, as mentioned, first disable the Sticky Navigation. Then, add this CSS in Appearance > Customize > Additional CSS:

    body {
        padding-top: 88px;
    }
    
    header#masthead {
        position: fixed;
        top: 0;
        z-index: 10000;
        width: 100%;
    }

    Here is an article with regards to adding CSS: https://docs.generatepress.com/article/adding-css/#additional-css

    Adding this through additional CSS should work.

    If you wish to apply this fixed nav on Desktop only, use this instead:

    @media (min-width: 1025px) {
       body {
        padding-top: 88px;
    }
    
    header#masthead {
        position: fixed;
        top: 0;
        z-index: 10000;
        width: 100%;
    }
    }

    Hope this clarifies! 🙂

    #2180866
    Annamari

    Hi Fernando,

    Thanks!

    I’m using the same function on a different site (link in private info box), and it doesn’t happen there… So that’s why I don’t understand.

    Thanks for your suggestion anyway!

    #2180883
    David
    Staff
    Customer Support

    Hi there,

    if you want to re-enable the sticky navigation i can take a closer look.

    #2180887
    Annamari

    Hi David,

    re-enabled, thank you.

    #2180899
    David
    Staff
    Customer Support

    Its annoying ‘bug’.
    The sticky nav is a clone of the default navigation. And when the sticky appears it adds 40px left and 40px right padding to the inside-navigation container.
    Which is fine for the sticky, but NOT the default nav, this extra padding causes the menu items to reflow and wrap to two lines so its now double the height and prone to peaking out when you scroll back to top and causes the annoying little bump.

    The other site is ok, as there is more space in the navigation to accommodate the padding without causing reflow.

    Options:

    1. makes some more space in the menu by reducing the menu item font sizes or menu item widths ( in customizer > Layout > Primary Nav ).
    2. enable the Navigation as Header option in Customizer > Layout > Header. If need be we can throw some CSS at it to make it look more like the current nav.

    Let me know

    #2181195
    Annamari

    Thank you, David, I enabled the Navigation as Header option, and now it seems OK to me!

    Appreciate your help, thanks again!

    #2181206
    David
    Staff
    Customer Support

    Glad to hear that!
    The Nav as Header is the best option 🙂

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