SkillAgentSearch skills...

Dragmove.js

A super tiny Javascript library to make DOM elements draggable and movable. ~500 bytes (minified+gzipped) and no dependencies.

Install / Use

/learn @knadh/Dragmove.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<a href="https://zerodha.tech"><img src="https://zerodha.tech/static/images/github-badge.svg" align="right" /></a>

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.

Related Skills

View on GitHub
GitHub Stars896
CategoryDevelopment
Updated20h ago
Forks48

Languages

JavaScript

Security Score

100/100

Audited on Mar 31, 2026

No findings