Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 441 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 441 Bytes

dragToMove.js

A tiny JavaScript library to make DOM elements movable with mouse or touch.

Usage

import { dragToMove } from "./dragToMove.js";

//Takes in two arguments
// 1. Main HTML element.
// 2. Child element inside the Main, on which the clicking and the dragging happens.
dragToMove(document.querySelector('div'), document.querySelector('.handle'));