DeDX Posted May 16, 2022 Posted May 16, 2022 Here's the codesandbox: https://codesandbox.io/s/gsap-transition-snap-react-p421y5 I want the building to smoothly disappear when it hits the trigger point. Instead of animating, building just snaps to opacity: 0.
Solution GreenSock Posted May 17, 2022 Solution Posted May 17, 2022 It looks like you're making one of the common mistakes - you're NESTING a ScrollTrigger inside tween that's inside a timeline. You can't have the ScrollTrigger and the timeline both fighting for control of the tweens playhead. See The solution: either put the ScrollTrigger on the timeline or don't even use a timeline at all and just use a standard tween: // BAD scTl.current.to(el("#building"), {... // GOOD gsap.to(el("#building"), {... Happy tweening! 1
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