1.0.10 • Published 2 years ago

dragoned v1.0.10

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

Dragoned

Dragoned.js is a library for drag-and-drop lists with different sizes of height

Features

  • Supports touch devices with touch events.
  • Can drag from one list to another.
  • Smart auto-scrolling on any device.
  • Easy to set up, plug & play!

Examples

Install

You can install it on npm.

npm install dragoned --save

Usage

<ul id="container">
 <li>item 1</li>
 <li>item 2</li>
 <li>item 3</li>
</ul>
 new Dragoned(document.querySelector('#container'));

Options

 new Dragoned(container,{
     group:"group-name",
     sort: true,
     draggable:"query-selector", // which element inside the container should be draggable.
     handle:"handle-element", //  Drag handle selector within list items.
     clone:true, // Clone the item.
     delay: 100 // time in milliseconds to start.
     onStart:({item, from, oldIndex})=>{

     },
     // on move an item in the list or between lists
     onMove:({item, from, to, newIndex, oldIndex})=>{

     },
     // on dragging ended
     onEnd:({item, from, to, newIndex, oldIndex})=>{

     },
     // on creating a clone of element
     onClone:({item, from, oldIndex}) =>{

     }
 });

Contributing

All contributions are super welcome!

Got questions? click here.

1.0.2

2 years ago

1.0.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.10

2 years ago

1.0.1

5 years ago

0.0.1

5 years ago