Minimalist Drag And Drop Library – js-dragndrop

Category: Drag & Drop , Javascript | November 16, 2017
Views Total:1,091 views
Official Page:Go to website
Last Update:November 16, 2017


Minimalist Drag And Drop Library – js-dragndrop


A vanilla JavaScript drag and drop library which enables you to drag DOM elements within a boundary you specify.

How to use it:

Just insert the JavaScript file ‘dragndrop.js’ into the document and you’re ready to go.

<script src="dragndrop.js"></script>

Add the CSS class ‘js-dragndrop’ to any elements which should be draggable. And add the CSS class ‘js-dragndrop-limiter’ to boundary elements.

<div class="outer js-dragndrop-limiter">
  <div class="inner inner--1 js-dragndrop js-dragndrop-limiter">
      Content A
          sub div
      <div class="inner inner--2 js-dragndrop">
          Sub-content A
  <div class="inner inner--3 js-dragndrop">
      Content B

Initialize the drag and drop library.


You Might Be Interested In:

Leave a Reply