Jump to content
Search Community

Translate y not working but when replaced with opacity the animation is working

johnmathew_247 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi @johnmathew_247. That CodePen doesn't work at all and even when I enable TypeScript, it says: "Uncaught SyntaxError: The requested module 'https://cdn.skypack.dev/react-router-dom' does not provide an export named 'Switch'". Please provide a functional demo and we'd be happy to take a look. 

 

If it helps, here's a starter template from CodeSandbox: https://codesandbox.io/s/gsap-react-starter-ut42t

 

Also, have you tried changing the "y" value to something else, like 200? I wonder if the issue is simply that your element is ALREADY at a y value of 100, thus it looks like nothing is happening. I'm totally guessing at this point since we don't have a functional demo to assess.

Link to comment
Share on other sites

  • Solution

Oh, that's because browsers don't render transforms on inline elements like that. It has nothing to do with GSAP - open Dev Tools and you'll see that GSAP is indeed applying the transforms properly, but some browsers don't render them on display: inline elements. Try setting them to inline-block

  • Like 1
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...