dragger
Dragger is a module that gives you the ability to drag anything with either the mouse or touch events. It doesn't do anything to the element except for add listeners. Add the functions 'start', 'drag', and 'stop' to get the position at each step.
Dragger(element [, options][, bounds])
Example
// Use an element or query selector as the first parameter// Use an object to overwrite the defaults for the second parametervar dragger = '#elementId' { // drag has started // pos.x is the initial left position // pos.y is the initial top position } { // drag has moved // pos.x is the new left position // pos.y is the new top position } { // mouse or touch has ended if hasChanged // position has changed from the original position // pos.x is the final left position // pos.y is the final top position } 'initX': 0 // set the initial X position if it is not zero 'initY': 0 // set the initial Y position if it is not zero 'allowVerticalScrolling': true // set this to allow vertical scrolling on touch devices 'allowHorizontalScrolling': true // set this to allow horizontal scrolling on touch devices; // If the position of the element that is being dragged has changed, let the dragger knowdragger; // If an element can't be dragged past a certain area, set the boundsdragger; // Check to see if the dragger handle has moved before allowing a clickdragger; // returns true or false // Disable the instancedragger; // Re-enable the instancedragger;