Drag To Sort Plugin jQuery - Download Simplest Drag To Sort Plugin For jQuery - drag-sort

Download Simplest Drag To Sort Plugin For jQuery – drag-sort

Posted on

This time I will share jQuery Plugin and tutorial about Simplest Drag To Sort Plugin For jQuery – drag-sort, hope it will help you in programming stack.

Drag To Sort Plugin jQuery - Download Simplest Drag To Sort Plugin For jQuery - drag-sort
File Size: 5.92 KB
Views Total: 3552
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The simplest jQuery drag to sort plugin which enables the drag’n’drop re-sort functionality on the list view. Without any 3rd dependencies such as jQuery UI.

How to use it:

1. Create a normal html list as this:

01 <ul id="wrap" class="wrap">
02   <li>
03    List Item 1
04   </li>
05   <li>
06    List Item 2
07   </li>
08   <li>
09    List Item 3
10   </li>
11   ...
12 </ul>

2. Download and include the drag-sort.js script along with the latest jQuery library at the bottom of the webpage.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="drag-sort.js"></script>

3. Call the function on the html list to enable the drag to sort functionality.

1 $('#wrap').dragSort();

4. Customize the default CSS styles while dragging and sorting.

01 $('#wrap').dragSort({
02   replaceStyle: {
03     'background-color': '#f9f9f9',
04     'border': '1px dashed #ddd'
05   },
06   dragStyle: {
07     'position': 'fixed',
08     'box-shadow': '10px 10px 20px 0 #eee'
09   }
10 });

This awesome jQuery plugin is developed by ylb1992. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net