Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/manufosela/draganddroplist

Vanilla Javascript class to do Drag And Drop List
https://github.com/manufosela/draganddroplist

Last synced: about 1 month ago
JSON representation

Vanilla Javascript class to do Drag And Drop List

Awesome Lists containing this project

README

        

# DragAndDropList javascript class

To make UL/LI HTML list dragAndDroped easily. It uses vanilla javascript.

# Install
```
$ npm install drag-and-drop-list
```

# Demo
[Codepen Demo](https://codepen.io/manufosela/pen/gOwbjBO);

# Local demo
```
$ npm run start
```

# Example

```javascript
import { DragAndDropList } from '../DragAndDropList.js';

const dndList = new DragAndDropList();
DragAndDropList.init();
```

# Contructor Parameters
const dndList = new DragAndDropList(first, second);

* first: ['replace'] || 'before' -> drag and drop mode
* second: callbackFunction -> callback function to run when drag and drop finish