Jump to content


ScrollTrigger toggle class of a related element not firing

Moderator Tag
Go to solution Solved by cotton,

Recommended Posts



I'm trying to get the titles on the left to add an active class when the related (by data-attributes) block on the right scroll to top.


The blocks and titles are all found when I console.log them but the toggle class function isn't firing.

I've tried using the onToggle: self functions but with the same result.


I can't figure it out, what am I missing?

See the Pen ZEMXoVg by Cottonltd (@Cottonltd) on CodePen

Link to comment
Share on other sites

  • 2 weeks later...

Thanks @mvaneijgen. The project has gone on the back burner since I posted this so haven't had chance to sit with it again. Looks like the effect is plain and simple in the demo so thanks for pointing me in that direction!

Link to comment
Share on other sites

  • Solution

Really silly error that I missed to fix this.

The panels/sections were 100vh so were ending the trigger as soon as it had started so just needed to alter the 'start' and 'end' positions. 


See the Pen OJoaZXW by Cottonltd (@Cottonltd) on CodePen

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