Fork me on GitHub

Sortable

— is a minimalist JavaScript library for modern browsers and touch devices (No jQuery).

List A

  • Catherine
  • Polina
  • Duke
  • Adnrey
  • Maxim

List B

  • Ilya
  • Anna

 

 

Multi

Group A
Group B
Group C

 

Code example

// Simple list
var list = document.getElementById("my-ui-list");
new Sortable(list); // That's all.


// Grouping
var foo = document.getElementById("foo");
new Sortable(foo, { group: "omega" });

var bar = document.getElementById("bar");
new Sortable(bar, { group: "omega" });


// Or
var container = document.getElementById("multi");
var sort = new Sortable(container, {
  handle: ".tile__title", // Restricts sort start click/touch to the specified element
  dragabble: ".tile", // Specifies which items inside the element should be sortable
  onUpdate: function (evt/**Event*/){
     var item = evt.detail; // the current dragged HTMLElement
  }
});

// ..
sort.destroy();