Andrew Thorp

Draggabilly helps make your HTML draggable

Draggabilly, by @desandro, is a small (~10k) JavaScript library that does one thing well — make that shiz draggable.

Installation is simple, just download and include the file. If, however, you are familiar with Bower:

> bower install draggabilly

Usage is simple too (from the README):

var elem = document.querySelector('#draggable');
var draggie = new Draggabilly( elem, {
  // options...

A few options are available: containment: #container will contain the element and handle: .handle lets you specify an element to use for interaction. Standard drag and drop events are available: dragStart, dragMove and dragEnd. While dragging, the element will have a .is-dragging class, so you can style it to your heart’s content!

View a demo or view the source on GitHub.


Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00