Mobile Compatible Drag And Drop Library – Draggin.js

Category: Drag & Drop , Javascript | May 26, 2019
Author: chrisnunes57
Views Total: 1,729 views
Official Page: Go to website
Last Update: May 26, 2019
License: MIT


Mobile Compatible Drag And Drop Library – Draggin.js


Draggin.js is a fast, cross-browser and mobile-compatible drag and drop library for JavaScript.

Thanks to the CSS transform property, the library automatically calculates the new position of the element relative to the top left of the page and then re-position the element to prevent from breaking the layout.

How to use it:

Insert the minified version of the Draggin.js into the document.

<script src="draggin.min.js"></script>

Add the CSS class ‘draggable’ to any element which should be draggable.

<img class="draggable" src="1.jpg"> 
<h1 class="draggable">Drag me</h1>

Make a text element editable with the ‘text’ class.

<h1 class="draggable text">Drag me</h1>



  • Added support for IE and Edge


  • Rename dragScript.js to draggin.js

You Might Be Interested In:

Leave a Reply