Jump to content
Search Community

Select div box on click and place into another box on click

LeoZ 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 GreenSock community,


I'm trying to implement one functionality opposite to drag and drop. 

I want to select div on single click and place it on click on any empty place boxes. So both things should be done by using single mouse click.

Can anyone guide how can I achieve this using GreenSock. Thanks in advance.


See the Pen qLvQbO by LeoZoe (@LeoZoe) on CodePen

Link to comment
Share on other sites

Thanks Mike,


Actually, it is started to moving on click but I want to select it on click and when I click on any empty box, then it will be moved into that box. Also, placement is random so I will try applying some math now.


Also it would be great if you help me with that too.


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