Jump to content
Search Community

Queueing .ticker callbacks before visual updates?

lunelson@gmail.com 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'm looking at the documentation for TimelineLite.ticker and I'm curious: is it possible to set a priority to the event listener, such that it would be run before tweens and timelines update visually? I'm thinking of, for example, touching the DOM in order to take measurements that might affect a progress parameter, to which timelines refer. Basically read/write or "measure/mutate" batching. 

 

addEventListener(type, callback, scope, useParam, priority)

 

Obviously, I can separate this in other ways but let's assume I need to read this value from the DOM just before the tweens and timelines update

Link to comment
Share on other sites

I should have read your post a bit more slowly... I just realised I misread your first sentence as: "I'm looking for..." rather than "I'm looking at...". Apologies for that. :oops:

 

I personally am can't say for sure but, my understanding of the way requestAnimationFrame and GSAP works is that, the ticker will dispatch its events after everything is computed and then, the rendering occurs. The browser is the one scheduling the draws, GSAP only updates whatever numbers its working with.

 

But, don't listen to me. I can't even read correctly... Mr. @GreenSock or @Carl should be able to give you a more definitive answer.

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