Rajeev Kannav Sharma

Posts About

Javascript multiple Div/Elements selection and sorting

23 Apr 2016

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

Usage

// 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."); }
});

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

Tweet to me at @rajeevkannav.