Mobile-friendly Drag And Drop JavaScript Library – Drog.js

Category: Drag & Drop , Javascript | September 25, 2021
Author:erovas
Views Total:1,446 views
Official Page:Go to website
Last Update:September 25, 2021
License:MIT

Preview:

Mobile-friendly Drag And Drop JavaScript Library – Drog.js

Description:

Drog.js is a tiny (1kb minified), cross-browser, and mobile-friendly drag and drop JavaScript library.

How to use it:

1. Import the Drog.js into your project.

<script src="Drog.min.js"></script>
<!-- OR -->
import "Drog.min.js";

2. Enable the drag’n’drop functionality on an element within the document.

<form name="drag-head">
  <div data-drog>
    <span>Click here to move</span>
  </div>
  <p>Move</p>
  <p>this</p>
  <p>ELEMENT</p>
</form>
Drog.on(document.forms["drag-head"]);

3. Move the element to a specific position.

let x = 100;
let y = 100;
Drog.move(document.forms["drag-head"], x, y)

Changelog:

v1.2.0 (09/25/2021)

  • Minor bug fix

You Might Be Interested In:


Leave a Reply