Jump to content
Search Community

Using gsap.set() to replace jQuery methods appears to be causing issues.

ektorp test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

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

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

  • Solution
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...