ektorp Posted September 20 Share Posted September 20 Hello team Greensock - I have a GSAP marquee that fits my needs fairly well. The only issue is that it is using some basic jQuery that I need to avoid. I attempted to simply replace the jQuery with gsap.set( ) calls, but this seems to be causing a slight imperfection. If you view the jQuery version (top marquee), it loops smoothly as expected. But when I then replace just a couple of jQuery calls with gsap.set() (bottom marquee), the first initial left block item seems to knock off unexpectedly causing an unsmooth loop. In initMarqueeBottom(), you can view just the 4 lines of modifications with native JS and gsap.set(). The jQuery calls are commented out for reference. Is there something I have missing with gsap.set() that is causing this issue? Once again, any help is greatly appreciated. See the Pen gOZoPNo by bdang (@bdang) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted September 20 Share Posted September 20 Hi, The best option is the Horizontal Endless Loop helper function: https://greensock.com/docs/v3/HelperFunctions#loop Here is one example: See the Pen ZELPxWW by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
ektorp Posted September 20 Author Share Posted September 20 Hi @Rodrigo Thank you for the response. Yes, I am aware of the horizontalLoop helper function. I just thought I had found a more simplified solution...with a minor gsap issue that could possibly get worked out. The horizontalLoop function clearly works well as is. My actual need is to have 2 marquees with 1 running left and 1 running right as my updated Codepen shows. Can this be easily achieved with horizontalLoop()? Any assistance with this would be very much appreciated Rodrigo. Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted September 20 Solution Share Posted September 20 7 minutes ago, ektorp said: Can this be easily achieved with horizontalLoop()? Absolutely! You can create as many as you want, just keep in mind that every loop instance should have different targets to prevent unexpected results: See the Pen dyQNeRZ by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
ektorp Posted September 20 Author Share Posted September 20 This will work great. Thanks so much @Rodrigo Your assistance is very much appreciated. 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