Jump to content
Search Community

Change Timelinemax Values After Page Load

Sam H. test
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

Hi,

 

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?

 

Thanks,

Sam

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.

 

http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

Thanks and happy tweening.

:)

  • Like 1
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.
×
×
  • Create New...