RollRoll
RollRoll

Reputation: 8462

Order Pictures by dragging and dropping with JQuery

I have a list of photos retrieved from database and displayed on the html. I would like to create an order feature by allowing the user dragging and placing on other picture position and replacing it.

something similar to the Queue priority from netflix

Is there an JQuery plugin for that? Do I have to develop from scratch?


due Scrooby answer I found exactly what I was looking for see below

enter image description here

Upvotes: 1

Views: 4902

Answers (2)

fanfavorite
fanfavorite

Reputation: 5199

Something like the jQuery UI Draggable + Sortable works well and should do the trick.

Upvotes: 1

Dan
Dan

Reputation: 5637

You can use jQuery UI Sortable to sort list items:

http://jqueryui.com/demos/sortable/

Or if you need to sort table rows, you can use:

http://archive.plugins.jquery.com/project/TableDnD

Each plugin has events that fire when the drag is complete, you can then run an Ajax call to update your database.

Upvotes: 5

Related Questions