Javascript multiple Div/Elements selection and sorting

jquery.multisortable is an open source Extension of jQuery UI Sortable, which works with multiple selected elements.

Usage

{% highlight ruby %} // simple case $(‘ul’).multisortable();

// some of the advanced usages $(‘div.container’).multisortable({ items: “div.item”, selectedClass: “selected”, click: function(e){ console.log(“I’m selected."); } stop: function(e){ console.log(“I’ve been sorted."); } }); {% endhighlight %}

Options

selectedClass: class which will be assigned to selected items.

Events

  • mousedown: this event will be fired when user starts to drag item(s).
  • click: this event will be fired when user clicks item(s).
  • start: this event will be fired when user starts to drag item(s).
  • stop: this event will be fired when user stop to drag item(s).
  • sort: this event will be fired when user sort item(s) after drag stop.

Demo

js.fiddle

And if you get stuck… Ask Here

email me rajeevsharma86@gmail.com

Avatar
Rajeev Sharma
Technical Lead

software entrepreneur and father of a fairy tale!!!.