Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 686 Bytes

Readme.md

File metadata and controls

36 lines (26 loc) · 686 Bytes

hammer-sortable

This is an extension for Hammer.js which implements sortable lists.

It depens on hammer-dragables.

Usage

var options =
  { handle: '.move'
  , draggable: 'li'
  , axis: 'y'
  }

var sortable = new Sortable($('ul'), options)
sortable.on('start', function (event, dragging) {
  dragging.element.classList.add('dragging')
})
sortable.on('end', function (event, dragging) {
  dragging.element.classList.remove('dragging')
})
sortable.on('change', function (dragging, moved) {
  // position changed
})

Install

$ npm install hammer-sortable

License

MIT