cotton Posted March 8, 2023 Posted March 8, 2023 Hello 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.
mvaneijgen Posted March 8, 2023 Posted March 8, 2023 I would copy the logic from the pen on the ScrollTrigger demos page, see below. Hope it helps and happy tweening! See the Pen bGVjLwG?editors=0010 by GreenSock (@GreenSock) on CodePen. 3
cotton Posted March 16, 2023 Author Posted March 16, 2023 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!
Solution cotton Posted March 23, 2023 Author Solution Posted March 23, 2023 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. 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now