Jump to content
Search Community

Update draggable element when it swaps position with another element

Jens De Muynck test
Moderator Tag

Go to solution Solved by Jens De Muynck,

Recommended Posts

Hi all!

 

When I drag and drop some boxes on to the main element, i'd like to be able to swap 2 elements with each other by dragging.

However when I swap 2 elements with each other, the dragged element is no longer correctly synced with my mouse.

I tried this.update()but that didn't seem to do much. How can i fix this? Or should I try a different approach?

 

TIA,

Jens

 

ScreenRecording2024-04-22at15_23.17-ezgif.com-video-to-gif-converter.gif.c419a6a6a07f7a10ea2dee1e6d237fd1.gif

See the Pen ExJGNbX?editors=1111 by JensDeMuynck (@JensDeMuynck) 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...