Jump to content
Search Community

Basic animation failed (close icon)

PatMa test
Moderator Tag

Recommended Posts

Hey PatMa. Let me explain what's going on.

 

You have a .from() tween which animates from the given values to the values at the time when it is created. So it will go from the transformOrigin of "100% 100%" to the transformOrigin value of "0.5px 25px". 

 

However, GSAP assumes that you don't want to actually animate the transformOrigin (because most of the time people don't want that to happen, they just want to set the value at the start or end. It is possible if you want to do that though). So it just sets the transformOrigin to "100% 100%" to start and changes it it to "0.5px 25px" at the end. Does that make sense?

 

You might be interested in reading the most common GSAP mistakes article because it talks about misusing .from() tweens:

 

I'm guessing you want to set the transformOrigin using a .set() call before you run that animation.

gsap.set([closeFirstLine, closeSecondLine], {transformOrigin: "100% 100%"});

 

  • Like 3
  • Thanks 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...