Gxneral Posted September 9, 2022 Share Posted September 9, 2022 I am building a website using React and I need to trigger an animation in a component that will affect the state of another component. I want to set scrub: true, start: "top bottom", end: "bottom top", The problem is I want to get the value of how far into the animation am I in. I want to log a value from 0% at the start to 100% at the end and transfer this value to another component. How do I get this value? Link to comment Share on other sites More sharing options...
Solution Gxneral Posted September 9, 2022 Author Solution Share Posted September 9, 2022 Oh I figured it out. Idk how did I miss the .progress in the docs this is what I was looking for ScrollTrigger.create({ trigger: ".trigger", start: "top bottom", end: "bottom top", onUpdate: self => console.log("progress:", self.progress) }); 2 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