Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Taylan

(Bug?) MotionPathPlugin unsets element position when looping in negative direction

Go to solution Solved by GreenSock,

Recommended Posts

Click next button multiple times. Whenever end value goes from -0.9 to -1.2, from -1.8 to -2.1, from -2.9999 to  -3.3 etc. the element moves to its default position. This is not expected right?

See the Pen eYzXzKg by taylankasap (@taylankasap) on CodePen

Link to comment
Share on other sites

Hey Taylan. Currently MotionPathPlugin only works with looping in the positive direction. So if you changed end to 

const end = start + distance;

and reversed the direction of your path it'd work as you'd expect. We'll discuss whether or not MotionPathPlugin should support looping in the negative direction and get back to you.

 

Side note: Make sure you're using the latest version of GSAP. That demo is using an old version :) 

  • Like 2
Link to comment
Share on other sites

Unfortunately I need to loop in both directions because I'm making a carousel with next & prev functionality. Thanks for considering this functionality.

Link to comment
Share on other sites

It works as expected now. Thank you Jack.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
On 11/17/2020 at 8:34 AM, GreenSock said:

Hello again, I think you guys are actively working on the script on this URL? I, unfortunately used that URL as CDN and now there is a bug (that wasn't there at the time of this post). Bug is mainly about sometimes element not animating at all when start and end values are different in integer level (I mean when it's moving from 1.8 to 2.1, -1.9 to -2.3 etc. You can see it on the original post's codepen. (Uncaught TypeError: Cannot read property 'samples' of undefined)

 

See the Pen NWRxMgG by taylankasap (@taylankasap) on CodePen

 

Of course this might be caused by me using MotionPathPlugin 3.6 with GSAP 3.5.1. Is there a GSAP 3.6 preview I can test? Or maybe MotionPathPlugin's old version so I can revert back to the working version for now  (and by old I don't mean 3.5.1, I mean the one you sent me the first time under this topic)?

  • Thanks 1
Link to comment
Share on other sites

I've downloaded it this time ^^ Thanks

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.
×