thetobiterra Posted October 2, 2023 Share Posted October 2, 2023 Hello, so recently i've been trying to come up with my own logic and approach to some very popular animations out there. I coded this up but for some reason, none of the marquee gets positioned back to the end of the other and i can't seem to understand why. Is my approach wrong? please help if you can See the Pen NWeLWGa?editors=0100 by the0xtobi (@the0xtobi) on CodePen Link to comment Share on other sites More sharing options...
mvaneijgen Posted October 2, 2023 Share Posted October 2, 2023 Instead of rolling your own have you seen the "Seamlessly loop elements along the x-axis" helper function from the docs? https://greensock.com/docs/v3/HelperFunctions#loop Link to comment Share on other sites More sharing options...
thetobiterra Posted October 2, 2023 Author Share Posted October 2, 2023 2 hours ago, mvaneijgen said: Instead of rolling your own have you seen the "Seamlessly loop elements along the x-axis" helper function from the docs? https://greensock.com/docs/v3/HelperFunctions#loop oh i know about the helper function, it's just that i like to think of how something would work and try it out myself sometimes. In this case, i thought this code made sense and would work and since it didn't, i'm just confused Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted October 2, 2023 Solution Share Posted October 2, 2023 Hi, If you want to create your own implementation (although in production I'd strongly recommend using the Helper Function) you should use the Modifiers Plugin: https://greensock.com/docs/v3/GSAP/CorePlugins/ModifiersPlugin Here is an example: See the Pen QEdpLe by GreenSock (@GreenSock) on CodePen Hopefully this helps Happy Tweening! Link to comment Share on other sites More sharing options...
thetobiterra Posted October 2, 2023 Author Share Posted October 2, 2023 6 hours ago, Rodrigo said: Hi, If you want to create your own implementation (although in production I'd strongly recommend using the Helper Function) you should use the Modifiers Plugin: https://greensock.com/docs/v3/GSAP/CorePlugins/ModifiersPlugin Here is an example: Hopefully this helps Happy Tweening! Thank you 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