axiome Posted April 6, 2021 Share Posted April 6, 2021 Hi Everyone, I'm new with Gsap and I want to make an infinite marquee, and change direction of the marquee if you scroll up or down. I succeeded to make it from right to left, but I don't have any idea how to proceed to change direction. The effect I want to reproduce is based on the Locomotive Agency website : https://locomotive.ca/fr Thank you. See the Pen abpyGQy by bappla (@bappla) on CodePen Link to comment Share on other sites More sharing options...
Solution OSUblake Posted April 6, 2021 Solution Share Posted April 6, 2021 Hi @axiome You can animate the timeScale of an animation. So something like this. let tween = gsap.to(".marquee__part", { xPercent: -100, repeat: -1, duration: 10, ease: "linear" }).totalProgress(0.5); ... gsap.to(tween, { timeScale: someCondition ? 1 : -1 // -1 will reverse the animation }); 3 Link to comment Share on other sites More sharing options...
axiome Posted April 6, 2021 Author Share Posted April 6, 2021 Wow, it works like a charm ! Thank you for the super fast reply. 1 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