Share Posted May 28, 2021 Hi, I like this animation very much! Can anyone help me to get, onThrowComplete event, to get a data or to add a class to the current item (that from middle with red title)? Thanks! See the Pen wvgaLxQ?editors=0010 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Share Posted May 28, 2021 You'd have to either craft an algorithm to figure it out (math based on the timeline's time mapped to the closest snapping point and which element is biggest at that point). I don't have time to do that for you, but here's a fork that just finds the biggest element at that point: See the Pen ExWwRZM?editors=0010 by GreenSock (@GreenSock) on CodePen let biggestElement = cells.slice(0).sort((a, b) => gsap.getProperty(a, "scaleX") - gsap.getProperty(b, "scaleX")).pop(); Then you can do whatever you want with that. Add a class or whatever. 1 Link to comment Share on other sites More sharing options...
Author Share Posted May 29, 2021 Thanks for your help! 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