简体   繁体   中英

How to use SmoothDnD library in Plain JS?

I am trying to use SmoothDnD libary.

All the example listed there are using React or Angular or Vue. I would like to use this library in plain JS. Is that even possible? Can someone guide me or show any example of how this can be used in plain html/javascript page.

Thanks in advance.

The API documentation for the plain-JavaScript API is right there on the page you linked , complete with this example:

<div id="container">
  <div>Draggable 1</div>
  <div>Draggable 2</div>
  <div>Draggable 3</div>
</div>

var containerElement = document.getElementById('container');
var options = {};
var container = SmoothDnD(containerElement, options);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM