Jump to content
Search Community

Fixed header - toggle based on scroll direction + smooth-scrollbar

Adiacent test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

  • Adiacent changed the title to Fixed header - toggle based on scroll direction + smooth-scrollbar
  • Solution

 

Hey there @Adiacent

 

That has to do with the fact that with most if not all smooth-scrolling libraries you can not have position fixed elements inside your scroller / smooth-scrolling container. So if you want position fixed elements to work as expected, you will have to place them outside of that scroller in your HTML markup like this e.g.

 

See the Pen 7698bf2eb6b8baff50ad9e603cfd2ef2 by akapowl (@akapowl) on CodePen

 

I highly recommend digging into how smooth-scrollbar works if you want to continue using it or you will only run into more roadblocks further down the road. Hope this helps for the start.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...