Jump to content
GreenSock

TRFC

AutoFitArea for TweenMax or TimelineMAx

Recommended Posts

Hello experts,

 

Is there any userguide or codepen example on how to us the AutoFitArea with TweenMax.

 

I want to scale images (which all might be different sizes) and elements to a known size -- a window or div in my html

 

AutFit Area seems to have the options I need but how to use with TweenMax ?

Link to comment
Share on other sites

AutoFitArea is only available for Flash / ActionScript.

Perhaps if you provide a basic CodePen example someone can give you some pointers. I'm thinking the solution is going to largley be focused on JavaScript or jQuery and not so much GSAP.

Link to comment
Share on other sites

Thanks for the answer.

I guess I can write the javascript code -- I already do this for the question I submitted on May 15th (New Feature [request] ) to find the co-ordinates of the viewport (even when scrolled) and then to modify the Tween vars.

 

I actually front the TweenMax with my function jwt_animate, intercept vars such as x:"right", and replace them with  left : and xPercent :  and for good measure add a new value in x: for the offset from the right margin. I think the codepen demonstrates this.

 

I was hoping that a function already existed.

I was also hoping that instead of fronting TweenMax, I could link my Javascript under the call line so that TweenMax did the calculations as a sub-routine.

 

Anyway, thanks for confirming that my requirement does not exist.

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