Site logo

Archived topic

Primary navigation - appear only upon scroll.

13 replies · Started by ammgbr on February 7, 2023

Viewing posts 1–14 of 14

Hi, how can I hide the primary navigation and have it appear only upon scrolling down?

I think there is a CSS solution back from a few years ago but this might be out of date.

Hi there,

Try this:

.main-navigation:not(.is_stuck) {
    display: none;
}

Thank you that's resolved! :D

You are welcome   :)

Apologies for the follow up, is it possible to have this CSS work only for the home page and not the rest of the website?

Yes, you just need to add .home to the selector:

.home .main-navigation:not(.is_stuck) {
    display: none;
}

thank you:)

No Problem :)

Apologies for coming back to this, the solution works for desktop but not for mobile. Is it possible to make it applicable to all devices??

Hello there,

Try replacing the code you have with this:

.home nav#mobile-header:not(.is_stuck) .inside-navigation.grid-container.grid-parent, .home .main-navigation:not(.is_stuck) {
    display: none;
}

Thank you :)

You're welcome! :)

Hi, the above code stopped working on mobile. Is there anything I should amend in the css above?

That CSS should still work - nothing has changed on our end.

I'm not seeing it being added either so I'm assuming that there is a syntax error somewhere as mentioned in your other post.

You can move it to the top of all your CSS to test as well.

This archived topic is closed to new replies.