Dooshan Posted November 2, 2022 Share Posted November 2, 2022 Hi, I'm having problems with infinite loop marquee - I don't know how to make it seamless. After the box "1" goes outside the container, it should be appended after the box "5" on the right. Here is the demo See the Pen jOKVPZO by stdusan (@stdusan) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted November 2, 2022 Solution Share Posted November 2, 2022 It's hard for me to decipher what you were trying to do there, @Dooshan but... There were errors in your JavaScript (adding an event listener to a null object for example) You were creating two completely different infinite loops simultaneously with totally different techniques on the same elements, so they were conflicting with each other. You had extra code in there that wasn't serving any purpose at all. Are you trying to do this?: See the Pen abKNwmr?editors=0010 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Dooshan Posted November 2, 2022 Author Share Posted November 2, 2022 48 minutes ago, GreenSock said: It's hard for me to decipher what you were trying to do there, @Dooshan but... There were errors in your JavaScript (adding an event listener to a null object for example) You were creating two completely different infinite loops simultaneously with totally different techniques on the same elements, so they were conflicting with each other. You had extra code in there that wasn't serving any purpose at all. Are you trying to do this?: Exactly! Thanks. I'm sorry, I shouldn't have play with the original pen. Link to comment Share on other sites More sharing options...
Dooshan Posted November 2, 2022 Author Share Posted November 2, 2022 Just one more question... is it possible to slow down the animation a bit? Link to comment Share on other sites More sharing options...
Rodrigo Posted November 2, 2022 Share Posted November 2, 2022 Hi, The loop helper function has a config object you can pass. In that object you can specify a speed property: - Optionally pass in a config object with values like "speed" (default: 1, which travels at roughly 100 pixels per second), paused (boolean), repeat, reversed, and paddingRight. If you want to make it slower just add a value of less than 1: const loop = horizontalLoop(boxes, { repeat: -1, speed: 0.75 }); Happy Tweening! 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