Jump to content
Search Community

On scroll down or scroll up or even on click gsap snapping not allowing to add active class to sticky side menu

chetan9477 test
Moderator Tag

Recommended Posts



I don't have time to go through all the code you have there and find a way to create a solution for that specific case, but I can advice you to create a simple ScrollTrigger instance for every section. Since the number of sections is the same as the number of sidebar elements, you can easily tap into ScrollTrigger callbacks and update the styles or classes of the sidebar elements.


Here is a super simple example of that approach:

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


Hopefully this helps.

Happy Tweening!

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