fonveton Posted March 29, 2022 Share Posted March 29, 2022 Hello, I'm looking for help something I couldn't work around. What I'm trying to do is with foreach and scrolltrigger animate each image, but I'm also trying reverse the animation for not current images. What should i do to solve this problem? You can see full demo here: https://demo.pentayazilim.net/bati-ip/ See the Pen bGaRrGo by manidar (@manidar) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted March 29, 2022 Solution Share Posted March 29, 2022 Have you seen .batch() https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.batch()? You can create enter and leave animations. I'd made them with opacity, but now updated them to have your initial animations, but you can animate what ever you want with them. See the Pen PoEjOpq?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen I've updated your start and end positions, but you can tweak them to your liking 3 Link to comment Share on other sites More sharing options...
fonveton Posted March 30, 2022 Author Share Posted March 30, 2022 Thank you i didn't know about batch. That solved my problem. 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