Jump to content
Search Community

How to pause Timeline

ejlee 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 which looks like this below

 

this.tl = new TimelineMax({paused: true})    
        
this.tl.to(this.images[this.count], this.duration, { y: '0%', force3D: true, ease: new Ease(BezierEasing(1, 0.055, 0.015, 0.985))})    
this.tl.to(this.images[this.count], this.duration, { y: '-100%', force3D: true, delay: 1, ease: new Ease(BezierEasing(1, 0.055, 0.015, 0.985)),clearProps: 'y'})     

this.tl.restart()

 

What i'm trying to achieve is to pause all animation that happens on this timeline, and any animation that is currently running on this "this.tl" timeline.

 

I have tried to use

 

this.tl.pause()

   

This pauses the animation, however if there is an animation already running it doesn't pause that.   Is there a pauseAll for the timeline?

 

I know I can use this code below, but I do not want to use it because this pauses all globally and it affects my other tweens.

TweenMax.pauseAll()

 

 

Link to comment
Share on other sites

Hi,

 

Hm, I can not think of a case where pausing a timeline would not pause all animations inside of it, especially ones that are already running.

 

this.tl.pause() should absolutely pause all animations inside tl and no others. Also, TweenMax.pauseAll() should pause every animation as you described as well. 

 

 

In order to help further we will need to see a reduced test case that shows the behavior you are describing (tl.pause() not working). There is a chance I may be mis-understanding the issue, but a demo will certainly be the best way to clarify the problem and for us to quickly propose a solution.

 

Here are some instructions on using CodePen to create a demo.

 

Thanks!

 

 

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