0.1.3 • Published 3 years ago

@knadh/dragmove v0.1.3

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

dragmove.js

A super tiny Javascript library to make DOM elements draggable and movable. Has touch screen support. Zero dependencies and 500 bytes Gzipped. Demo here.

Usage

Node

npm install @knadh/dragmove
import { dragmove } from @knadh/dragmove;

// (target, handler, onStart(target, x, y), onEnd(target, x, y)).
// onStart and onEnd are optional callbacks that receive target element, and x, y coordinates.

dragmove(document.querySelector("#box"), document.querySelector("#box .drag-handle"));

ES6 module

Check this example to include dragmove.js as a <script> directly on an HTML page.

Licensed under the MIT License.

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago