Jump to content
GreenSock

martis

Update values on resize without creating handle resize

Moderator Tag

Recommended Posts

Heya,

 

Have there been any advancements in terms of updating values on resize without calling an onResize function and recreating the timeline? 

Link to comment
Share on other sites

Hey there, thanks for being part of Club GreenSock!

That's hard to say  for sure without seeing your specific use case. With ScrollTrigger we have invalidateOnRefresh, but largely for timelines the best method is to recreate on a debounced resize event, yes.

Can you maybe pop a pen together for us?

Link to comment
Share on other sites

do you have a debounce example as you mentioned? Also, is there a way to define a value as a function every time the playhead hits that tween? Or is that function only called once upon creation.

Link to comment
Share on other sites

Hey, @martis. Would you please provide a minimal demo (like a CodePen) that clearly shows what you're trying to do in the most basic fashion possible? 

 

You might want to look at the new gsap.matchMedia() method. 

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