Jump to content
Search Community

Attraction between Elements

mindthegap test
Moderator Tag

Recommended Posts

Hello, I'm probably wrong here, but maybe someone can give me a tip. I want to connect a group of divs like with rubber bands, say 5-7 images are connected in a group. if I move one of the images, the other images should move as well.

Can I do this with gsap or is there a physics library that I can use to do this?

Link to comment
Share on other sites

Hi,

 

You can definitely use GSAP for the animations, but for the other part my first approach would be a physics library that handles that particular part.

 

Of the top of my head I know that the Inertia plugin tracks velocity, end values and Draggable will track direction, so you can definitely get some data for the element being dragged. How that will affect other elements "linked" to that one? That might be the key here and the most difficult part of this.

 

https://greensock.com/docs/v3/Plugins/Draggable

https://greensock.com/docs/v3/Plugins/InertiaPlugin

 

Hopefully this helps.

Happy Tweening!

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