Jump to content

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

ScrollTrigger -- how to set a class on reverse

Go to solution Solved by GreenSock,

Recommended Posts

I have a trigger that works correctly scrolling forward, but not backward. Going forward, I want the navbar to change from highlighting Part 1 to highlighting Part 2 at a certain point, then to change from highlighting Part 2 to highlighting Part 1 when you scroll backward past that point. My code doesn't work for the backward scrolling part. What am I doing wrong please?

See the Pen xxYRwGX?editors=1111 by lschneiderman (@lschneiderman) on CodePen

Link to comment
Share on other sites

  • Solution

I think you meant onLeaveBack instead of onEnterBack. And there's no point in having reverse: true (no such thing) or toggleActions (that only applies if you have an animation associated with it): 

See the Pen LYQbNdy?editors=1010 by GreenSock (@GreenSock) on CodePen

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