Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

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

Go to solution Solved by akapowl,

Recommended Posts

putting the smooth scrollbar, the fixed header as on your example no longer works, you can give me a hand. Removing the smooth scrool's js code works fine.


See the Pen qBawMGb by GreenSock (@GreenSock) on CodePen



See the Pen PopjGbz by marcotorcolacci (@marcotorcolacci) on CodePen

Link to comment
Share on other sites

  • 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.