Jump to content
Search Community

repeatRefresh doesn't repeat at all

nucro test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi,

I'm struggling with repeatRefresh since I need to recompute the backgroundPosition at each repeat to make it loop but putting repeatRefresh on true makes the animation run just one time 😕

 

I tried putting my animation in a timeline and affecting the repeat to the timeline but same result ...

 

I'm pretty new to gsap so I guess I'm the problem but I can't find it, I would need help please ! 😄

 

Thanks in advance.

See the Pen XWYNjjO by nouchata (@nouchata) on CodePen

Link to comment
Share on other sites

  • Solution

That's because your function was returning the exact same value every time, so after the first iteration, you'd be tweening from the same value to the same value (no change). 

 

I assume you wanted something like this?:

See the Pen NWzbpdw?editors=0010 by GreenSock (@GreenSock) on CodePen

 

So it's easier than you may have expected :)

 

Enjoy, and welcome aboard!

  • Like 2
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...