_josch Posted January 20, 2022 Share Posted January 20, 2022 Hello, thanks for taking the time to read this post! The animation is working perfectly the first time it's played. When the user scrolls into the section for the first time, the title is revealed through opacity. However, once the user has scrolled past the section once, the title's opacity is permanently visible. Toggling it via toggleClass would not be possible because that would override my fade-out animation at the end. The animation for you to see: https://gyazo.com/a039115c24884cd24e12cf45fac2ff97 The class of "title-vis" (means title is visible) should only be removed, if the user scrolls above the section again. Is there a function to make that happen in GSAP? Didn't find anything like that on the Forum. Link to comment Share on other sites More sharing options...
Solution _josch Posted January 20, 2022 Author Solution Share Posted January 20, 2022 I found the solution, it is the same as "onReverseComplete" if anyone ever has the same problem 1 Link to comment Share on other sites More sharing options...
elegantseagulls Posted January 20, 2022 Share Posted January 20, 2022 47 minutes ago, _josch said: I found the solution, it is the same as "onReverseComplete" if anyone ever has the same problem You could also consider ScrollTrigger's onLeaveBack callback. https://greensock.com/docs/v3/Plugins/ScrollTrigger 1 Link to comment Share on other sites More sharing options...
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