Jump to content
Search Community

Dynamic X position

Sean19 test
Moderator Tag

Recommended Posts

Hello. In the codepen I provided above I have it so that when a circle with the class of social is clicked, an alert is given with the x position of the circle. I did this because what I would like to do, is when a circle is clicked, I want the purple rectangle with id mix, to have its x position moved to under that circle. So for example, if the third circle is clicked, I want the purple rectangle to move x: 966. And then if the second one were clicked after that, I would want it to move back to the second one. Right now I just have the rectangle move x:200 so I can make sure I am selecting it properly. I was wondering if this was possible in GSAP. 

See the Pen wvvxgKW by joseph19 (@joseph19) on CodePen

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