Jump to content
Search Community

Div Moves when it changes size and I have changed the Scale

greg_mich test
Moderator Tag

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

Currently I have a div that I am using TweenMax.to(this.$refs.keyboardContainer, 0, {scale:this.zoomRatio, force3D:false}); to resize the div. After I have resized it I change some of the contents inside the div that cause the height of the div to change, and when it does this it moves the Y location of the div. I am wondering how I can get the div that has been rescaled to stay in the same Y location even if it has changed in pixel height.

 

Thanks!

Link to comment
Share on other sites

I found that transformOrigin helped my case. Do you know how I can transform from just the top and not from the left? This code now transforms from top left, how do I get it to transform from just the top?

 

TweenMax.to(this.$refs.keyboardContainer, 0.35, {scale:this.zoomRatio, force3D:false, transformOrigin:"0 0"});

 

Thanks for all your help!

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