Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drag and drop ordering of images

I have 5 images that go into a banner on my homepage. These images are stored in the database but what I would like the user to do is drag and drop them so they retain some order.

What I need to do is a

(i) drag and drop the images in a container div so left if position 1 and right is position 5.

(ii) on sumbit save the position as a field in the database.

Some pointers would be nice, probably use jquery if possible.

Thanks.

like image 298
Roscoe Avatar asked Oct 13 '10 12:10

Roscoe


1 Answers

Use jQuery UI's Sortable and it's associated methods to do a AJAX call to your server on state change.

like image 174
Tatu Ulmanen Avatar answered Sep 24 '22 15:09

Tatu Ulmanen