Jump to content

Sam H.

Change Timelinemax Values After Page Load

Moderator Tag
Go to solution Solved by Sam H.,

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



is there a way to change the value of the timeline after the page has loaded? For example, i have a responsive website we're working on and i need to split two panels together on the page 50/50. when i reach a certain breakpoint the spilt percentage of each needs to change to something like 60/40.


Is there a way to update the values after the page has loaded?




Link to comment
Share on other sites

Hi Sam :)


I'm not sure I completely understand your scenario, but you can kill() a tween or set up a new one that overwrites the old. You could also feed variables into it via a window resize event. Without seeing some code, it's hard to say the best way to achieve your goal. 


If you could please create a CodePen for us, there are a lot of great people around here that can give you some answers.




Thanks and happy tweening.


  • Like 1
Link to comment
Share on other sites

Thanks for the reply! i hope this helps to illustrate what i'm trying to achieve:

See the Pen XKmKvw?editors=0010 by proofinteractive (@proofinteractive) on CodePen


Pretty much on resize i want to update the height of the 'actionMenu'. Please let me know if this helps.




Link to comment
Share on other sites

  • Solution

I got this to work. for some reason it wasn't rendering the animation on resize but when i changed the staggerFrom's to staggerFromTo's it worked fine. I also threw a nice little debounce function in there as well and all seems good to go! thanks.

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.