Jump to content

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

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

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 post
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 post
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 post
Share on other sites

It works as expected now. Thank you Jack.

  • Like 1
  • Thanks 1
Link to post
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.