Jump to content
Search Community

TransformOrigin Not Working Properly

Shehzad Asif test
Moderator Tag

Recommended Posts

Hy There

 

I am getting an odd behavior when I use transform origin for width from left to get revealing effect from left as you can see in the demo. The problem is on my machine it transforming from center, no matter what transform origin I use. It will reveal the image from center. But in codepen, transform origin works okay but its scaling up and down the image. Can any one help me what I am doing wrong.

 

Regards,

Shehzad Asif

See the Pen VwjYEJj by ShehzadAsif (@ShehzadAsif) on CodePen

Link to comment
Share on other sites

Hey Shehzad. You should set the transform origin beforehand like gsap.set(".img-wrapper", {transformOrigin: "left"});

 

In terms of the scaling, that's just because the image is taking up the available size. There are a lot of ways to fix it including changing removing the width and doing max-width: 60vw; instead.

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