Dragged div change places with destination

Posted by Cudos on Stack Overflow See other posts from Stack Overflow or by Cudos
Published on 2009-05-11T14:38:30Z Indexed on 2010/05/16 22:40 UTC
Read the original article Hit count: 231

Hi.

Maybe a bit complex to explain. I have a grid with 9 images 100 x 100 px like this (each number symbolize a picture):

1 2 3
4 5 6
7 8 9

What I want is that the user can drag and drop e.g. 9 over 1 and they change places like this:

9 2 3
4 5 6
7 8 1

Sortables from jquery UI will not work since their solution is using floats. That will "push" all the boxes to the right or left e.g.:

9 1 2
3 4 5
6 7 8

thanks in advance.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery