Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Sep 15, 2020
Sep 15, 2020
Sep 15, 2020
Sep 15, 2020

README.md

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 HTML page.

Licensed under the MIT License.

About

A super tiny Javascript library to make DOM elements draggable and movable. ~500 bytes and no dependencies.

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.