1.0.3 • Published 4 years ago
drags.js v1.0.3
Drags.js
A simple library to make elements draggable
Features
- Lightweight
- Extendable
- Easy to use
Usage
Drags.js only has one function that is exposed to the window: drags
. You can pass an HTML element into drags.
Example:
drags(document.getElementById('element'))
Since Drags.js does not have element selections built in, you can add interactions to multiple elements like this:
let assign = document.getElementsByClassName('drag')
for(let elem of assign) drags(elem)
Supported Browsers
All browsers that support 2D transforms and ES6 will run Drags.js fine. Future versions will support more browsers, but for now the focus of Drag.js is efficiency and speed.
Updates
- Now works on scrollable windows!