Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Gary Griswold

scale between zero and one

Recommended Posts

Hello,

 

I am trying to get a small scrollable body of text (the table of contents) to appear starting from under the button that is clicked to present the table of contents.  Then I want the table of contents to disappear by a reverse animation back under the button when the user has selected a place in the table of contents.

 

I have a solution that partially works, but if the user has scrolled to the bottom half of the table of contents, the tween to remove the table of contents is happening twice.  Or maybe it is starting, getting interrupted by something, and then finishing.

 

This is a 'single page' mobile app.  So pages of text are being removed from the DOM when the TOC is shown, and added to the DOM when the TOC is removed.

 

I don't know if I could fit the essential ingredients into a codepen, but these are the two tween calls that I am using.

 

Show:

TweenMax.fromTo(this.rootNode, 0.7, { css: {scale:0} }, { css: {scale:1, transformOrigin:"left top"}, ease:Power4.easeOut});

 

Hide:

TweenMax.fromTo(this.rootNode, 0.7, { css: {scale:1} }, { css: {scale:0}});

 

Thanks for any help you can provide.

Link to post
Share on other sites

Hm, I'm having a really tough time understanding the question. I'd like to help, but it's tough to troubleshoot blind. A simplified codepen would really help. 

Link to post
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.

×