0.5.0 • Published 4 years ago

@samuelpetersson/dom-drag v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

dom-drag

Concept

//Create a new gesture.
var gesture = drag.createGesture(element, callback);
//Dispose and stop gesture.
gesture.dispose();

Examples

//Implement the callback to receive state change (began, moved and ended), position and velocity of current event.
drag.createGesture(element, function(state, {position, velocity, target}) {

	switch(state) {
		case 'began':
			//Drag gesture began.
			break
		case 'moved':
			//Drag gesture moved.
			break
		case 'ended':
			//Drag gesture ended.
			break
	}

});