Antibreez Posted March 14 Share Posted March 14 Hello! Here is my problem. I have animation: several blocks moving along some path. This animation is snapped to ScrollTrigger with normal speed. And also I need to make same animation, but very slow when this block is in viewport but page is not scrolling at the moment. Can anyone please help to solve it? So I need both: 1. animation on ScrollTrigger with normal speed and 2. Infinite slow animation while not scrolling. See the Pen zYXBowz?editors=1010 by antibreez (@antibreez) on CodePen Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted March 14 Solution Share Posted March 14 Hi @Antibreez and welcome to the GSAP Forums! In this particular case is better to not tie the animation to ScrollTrigger and have it running on an endless loop, then use ScrollTrigger to play with the animation's timeScale property, like this: See the Pen NWmRMpy by GreenSock (@GreenSock) on CodePen Finally I'd suggest this approach by @PointC, is far simpler and easier to maintain IMHO: Hopefully this helps. Happy Tweening! 2 Link to comment Share on other sites More sharing options...
Rodrigo Posted March 14 Share Posted March 14 I also forgot, last but not least, check this video @Carl made about this particular subject, it's really great: 1 Link to comment Share on other sites More sharing options...
Antibreez Posted March 15 Author Share Posted March 15 10 hours ago, Rodrigo said: Hi @Antibreez and welcome to the GSAP Forums! In this particular case is better to not tie the animation to ScrollTrigger and have it running on an endless loop, then use ScrollTrigger to play with the animation's timeScale property, like this: Finally I'd suggest this approach by @PointC, is far simpler and easier to maintain IMHO: Hopefully this helps. Happy Tweening! Thank you very much! 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