Jump to content
Search Community

A delay on Reverse timeline resets to 0 after a second reverse?

omarel test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I have a timeline that runs. When you click a replay link the timeline reverses and then replays. I wanted to add a slight delay only right after the timeline gets reversed and the timeline replays. It works great when you click replay the first time, you can see the delay, but when you click replay one more time, the delay disappears and the replay happens instantly.

 

How can I stop this delay from disappearing? 

 

(Please click replay twice to see the difference) The delay is on the last line in my js file.

function restartAnim() {
	tl.restart().timeScale(speedOfAnim).delay(1);
}

 

 

See the Pen xMVbZR by omarel (@omarel) on CodePen

Edited by omarel
more context
Link to comment
Share on other sites

hmm, a search led me to a form answer explaining that initial delay goes away after it runs once so it won't come back.

 

I'm wondering how to solve this. I guess I can add a delay to the first item in the timeline and the delay will happen all the time, but what if i want 0 delay when it first runs, and only that recurring delay on all repeated timelines...

 

src:

 

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