Jump to content
Search Community

Moving Element to a Position's Relative to Container

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

Hello,

 

I'm working in this animation where I first scale down 2 boxes using their default transformOrigin values, then I want to move them to the container's top:0 in a way that their top edges align with the container's top edge, I changed the boxes' transformOrigin to "center top" and it immediately aligns them to the container's top edge, which makes sense, but I want to do that with a tween. I specified a duration but it is not having any effects.

 

Can you please help me with this?

 

Thanks.

 

See the Pen LerXzJ by anon (@anon) on CodePen

Link to comment
Share on other sites

Hi @salas.jsm,

 

Welcome to GreenSock Forum.

 

Please take a look at these explanations: https://greensock.com/position-parameter

 

The positioning of a tween can be selected with several options.

Here 2 sec after the end of the last tween:

 

See the Pen 622b893129dbb76fdcc2b9597ffd85bb by mikeK (@mikeK) on CodePen

 

If this does not lead to the desired solution, please let us know.

 

Happy tweening ...

Mikel

 

 

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