Jump to content
Search Community

Bezier ending point

Yaaaaar 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 everyone! I had a question about ending point of bezier curve. If I'm using x and y properties in bezier function, my balls fly much further than the point(x:1073, y:0) I indicated with each execution of function. When I'm using left and top properties balls fly specifically to this point(left:1207, top: 100) constantly, but i can't use that, because i have a checkFirst fucntion, which is using left property to compare. I tried to use _gsTransform.x, but this is not a option, because for each element it's the same. Could you help me with that, please? Thanks!

See the Pen OOePzL by Yaaaaar (@Yaaaaar) on CodePen

Link to comment
Share on other sites

transform values like x and y are relative to the objects natural position.

 

If you have an item with left:100px and another with left:200px, their x value is 0. If you give them both an x of 100, they will move 100 pixels to the right of their current position landing at 200px and 300px respectively.

 

The solution for you is to give all your balls position:absolute. This will in effect put them all in the same place with x:0, y:0. You can then place them in a row  and space them however you like (I use a TweenLite.set()) and then if you tween them to the same x,y values they will end up in the same spot

See the Pen KyjarO by GreenSock (@GreenSock) on CodePen

 

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