Jump to content
GreenSock

Tedev

Timeline restart has delay?

Go to solution Solved by PointC,

Recommended Posts

Good day!

After messing with some more GSAP I found some fun stuff to work with.
Currently I'm messing with this timeline, which I'd like to have animate instantly after completion.
But even after giving 0 delay to the timeline AND the tweens it seems after each timeline-restart it adds a delay exponentially.
My question is: Why is this? Haven't I given all properties 0 delay?

Thanks in advance,

Tedev

See the Pen bGLQqXz by tedev (@tedev) on CodePen

Link to comment
Share on other sites

  • Solution

That's because of your onComplete. You're adding tweens to the end of the timeline on each repeat so the timeline is getting longer and longer. I assume you just wanted something like this.

 

See the Pen 9ad77250a0432d7baf26d1e377b56d5d by PointC (@PointC) on CodePen

 

Hopefully that helps. Happy tweening.

:)

 

 

 

  • Like 3
Link to comment
Share on other sites

It just occurred to me that you may have wanted the echoes to all come to a stop before it repeats. If that's the case, using amount for the stagger and an equal value for the repeatDelay would work well. Happy tweening.

 

See the Pen d29854ac5aaca6dd46fcd8d50dbcdc73 by PointC (@PointC) on CodePen

  • Like 1
Link to comment
Share on other sites

2 hours ago, PointC said:

That's because of your onComplete. You're adding tweens to the end of the timeline on each repeat so the timeline is getting longer and longer. I assume you just wanted something like this.

 

 

 

 

Hopefully that helps. Happy tweening.

:)

 

 

 

Thanks for your fast reply!
This is indeed the issue I was encountering!

After looking at the fix I realize my mistake.

Thanks for the help, Craig! :)

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