Jump to content
Search Community

Pause a timeline

freuxdesbois 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

Hi,

 

Thanks for the demo.

 

I think you want to use addPause() here

 

tl.addLabel('step1')
.to('.red', 0.5, {width:250})
.addPause()
.addLabel('step2')
.to('.blue', 0.5, {width:450});

 

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

 

you use pause() to pause a timeline at any time. 

The way you were using it you were pretty much pausing it as the timeline was being created.

 

addPause() inserts a pause into a timeline at a specific point in time.

 

more info here: https://greensock.com/docs/TimelineLite/addPause()

  • Like 5
Link to comment
Share on other sites

Awww thanks for the explanation, I feel less stupid :)
The difference is subtle but crucial


Ok, another question related to this, sorry.
So I added a reverse button, and if I push it let's say 3-4 seconds later than step1, the blue square flashes then disappear...
This is tricky because it doesn't seem to happen everytime...
Is there a way to avoid this flash thing?
 

See the Pen jeVbZM by freuxdesbois (@freuxdesbois) on CodePen



 

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