Jump to content
Search Community

Scroll Snapping with ScrollSmoother

marco_sohn test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

  • Solution

Seems like the bootstrap version you're adding (5.0.2) is adding something that screws up the logic. 

 

See the Pen abXGOQL by mvaneijgen (@mvaneijgen) on CodePen

 

Yep, it is scroll-behavior:smooth that Bootstrap adds to the HTML element 

 

If you set it to auto on your CSS it fixes the issue. Hope it helps and happy tweening! 

 

Side note, you also want to subtract one section from your snap logic, because it starts already at the first one, so you don't want to count that one. 

 

See the Pen JjxvYjv?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

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