Fax Posted August 8, 2024 Posted August 8, 2024 I am a new programmer and I have been approaching the gsap world for a few days. In this pen I've tried to operate two different scrolltriggers. It works but I know that is the wrong way. Could you suggest me a more correct and clean script to activate more triggers scrub mode? Thank you. See the Pen XWLaeEg by ilpiubello (@ilpiubello) on CodePen. 1
mvaneijgen Posted August 8, 2024 Posted August 8, 2024 Seen that both tweens need to play at the same time. I would setup one timeline and just add the tweens to that one timeline. Then you can use the position parameter to have both tween start at the same time. Hope it helps and happy tweening! See the Pen yLdoPmx?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen.
Fax Posted August 8, 2024 Author Posted August 8, 2024 @mvaneijgen thank for answer. In your example, there're two path is animating simultaneously, instead I would like to separate the tweens; in fact in my pen there are two timeline (with double markers to personalize points of intersection)... I don't know if I explained myself well...
mvaneijgen Posted August 8, 2024 Posted August 8, 2024 Oh to be it looks like they were doing the same thing, but then there is no need to optimise. If it works, it works! 1
Solution ryan_labar Posted August 8, 2024 Solution Posted August 8, 2024 Hi @Fax If you're looking to get away from the switch cases (if you had a lot of animations on one page) you could do something like: See the Pen bGPrayO?editors=0010 by ryan_labar (@ryan_labar) on CodePen. 4
Fax Posted August 9, 2024 Author Posted August 9, 2024 14 hours ago, ryan_labar said: Hi @Fax If you're looking to get away from the switch cases (if you had a lot of animations on one page) you could do something like: Yes! This is perfect: clean and concise.
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