Jump to content


.addPause not pausing when using seek()

Go to solution Solved by GreenSock,

Recommended Posts

Hi! First thanks a lot for your hard work, amazing proposal of logic-relations-business (first contribution so a little excited).

In general for several years I have trusted gsap to the extend of sometimes not knowing if I am using javascript or gsapscript. Only now I encountered a situation where I recognized that every tool has it point of view, in the sense of being looking at things from a certain perspective. What I mean is this: I have a timeline with animations separated with .addPauses that are controlled from keyboard, it is a menu so up and down, no problem. I also want to control it with mouse so I figured that could just add a seek('label') and that's it, but I discovered that when the timeline is paused with .addPause and then jumped to another position with seek it sometimes played, until I used seek().pause(). Is that the intended behavior? Thanks for your time.

Link to comment
Share on other sites

  • Solution

Welcome to the forums, @soymos!


It's pretty tough to diagnose blind - do you have a minimal demo we could look at? 


Keep in mind that what you're asking is inherently ambiguous because if there's a pause at a specific spot and then you seek() to that EXACT time, a case could be made that that it should trigger the pause, or that it shouldn't. Think of a seek() like picking up the needle on a record player and dropping it at the beginning of a song (which is also the end of another song). Imagine the record had a ridge there that'd pause the record player when it runs into that ridge at the end of the one song...but it's also at the exact same spot as the beginning of the next. If you drop it right there, should it pause or not? Is it the end of one song or the beginning of the next? It's both in this case.  


If your goal is to make sure it pauses, yes, just seek().pause() to make it explicit. 👍

  • Like 1
Link to comment
Share on other sites

Ok, you are probably right, ambiguity between the glass half full or half empty is always one of the things that most breaks my head, I guess it also make me more empathic because you never know. I reverted the change in my website, probably a simple enough example. You can use Tab to go down and Shift Tab up, go down a couple o three steps and then with your mouse return to where it say soymos without touching any other and it will continue to the next step without pausing, if you go down it will continue down or up if you go up (which is play() down and reverse() up). Thank you for you response.



Link to comment
Share on other sites

Hey @soymos. No need to mention me - anyone who has participated in the thread will automatically get notified of future responses. 


If you'd like us to look into something more, please provide:

  1. A minimal demo (NOT a live web site). A CodePen is ideal, with only the absolutely essential code to show the issue. 
  2.  A clear explanation of what you're looking for or what your question is. 

I wasn't sure if you were telling me about your site because you thought there's still a problem and you wanted us to look into it or if you were just sharing what originally prompted your question (but maybe now it's resolved?)


It's pretty unusual to build out all the animations in a timeline with a bunch of addPause() calls in there. I mean, it's totally possible and I wouldn't say it's "wrong", but I suspect there may be a cleaner way to structure things. If you still want some help, we'd be glad to take a peek at a minimal demo - see https://greensock.com/demo


Happy tweening!

  • Like 1
Link to comment
Share on other sites

Ok it is solved, I tought maybe it would be important to you, but as you have said is a matter of perspective and I bet there are millions of different perspectives out there, better to stick with what is needed. Thank you a lot, keep up the good work, one step at a time ;)

  • Thanks 1
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.