Jump to content
GreenSock

Sam H.

Change Timelinemax Values After Page Load

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

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.

 

Thanks,

Sam

Link to comment
Share on other sites

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