Jump to content
Search Community

timeline skips after initial play

d4rklit3 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 timelines in my site which have animations added to them in sequence. The first time i play a particular timeline it plays fine, any time after that it skips whatever is in the first .add()   or it just skips the first label .. I am not even sure how to describe this. One example is that I have an abstract that defines a sitesection (SectionViewBase). on the transitionin function it creates a timeline ads the global transition for each section and then there is a transitionInComplete function that is overwrote by the childclass that subclasses SectionViewBase. the override will return a new timline or tweenlite instance that is the transitionin of the specific section content. ANyways, the first time I do this its fine, however the second time it skips that initial .add() call and just plays whatever it gets from transitionInComplete().   Each time this tranistionIn function runs, however, it recreates the timeline. Any suggestions? Thanks.

Link to comment
Share on other sites

Hi,

 

It's hard to see what happens just with a description, but my guess will be an overwrite issue.

 

Any chance that you could set up a reduced live sample (codepen or fiddle), or upload a file that contains just this issue?.

 

Cheers,

Rodrigo.

  • Like 1
Link to comment
Share on other sites

Its hard to make an example because i think the the issue is coming from the intricacies of the rest of the site i am building. I can say this, the timeline skipping issue only happens when a set of events is initiated by something changing in the browser history (using backbone). so when i switch pages it seems that the browser lags after the history changes. I can't explain it, its quite baffling.

 

[EDIT]

I can confirm this is indeed the case. animating on a pushstate event causes the browser to halt or delay js execution.  I found this issue on impress.js talking about.

https://github.com/bartaz/impress.js/pull/97

 

There is probably very little no chance that browsers are going to fix this any time soon. I guess developers should be weary of this when animating right on browsery history change.

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