Enable HTML5-Based Drag-and-Drop Functionality In The List of Items | jQuery DragNDrop


jQuery DragNDrop is to enable the drag and drop functionality in the list of items. DragNDrop is a jQuery plugin that allows you to rearrange an ordered (or unordered) HTML list using drag and drop. Without the need for jQuery UI.

html sort select options, html sort list, html sort list by date, how to sort drop down list in alphabetical order in html, html sort list alphabetically, javascript drag and drop reorder div

How to make use of it:

1. Download the JavaScript jquery.dragndrop.js and place it after the jQuery library.

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" 
<script src="./jquery.dragndrop.js"></script>

2. Just call the function in your HTML menu and the plugin will do the rest.

<ul class="demo">
  <li> List Item 1 </li>
  <li> List Item 2 </li>
  <li> List Item 3 </li>

<ol class="demo">
  <li> List Item 1 </li>
  <li> List Item 2 </li>
  <li> List Item 3 </li>

3. Get the menu item you just dropped.

    onDrop: function( element, droppedElement ) {
      console.log( 'element dropped: ' );
      console.log( droppedElement );

4. Reset position.


5. Disable/reconfigure the drag and drop functionality.




unload Disable the jQuery Drag & Drop functionality.

reload Reload the jQuery Drag & Drop functionality. Useful if you dynamically add/remove items to be dragged and dropped.

reset Reset elements back to their original position when page loaded. NOT YET IMPLEMENTED



Fires after element is dropped into its new position.

onDrop( element, droppedElement )

element: The original element targeted for .dragndrop().

droppedElement: The element that was moved.

Reorder HTML List Using Drag And Drop, jQuery DragNDrop Plugin/Github, html5 drag and drop reorder list, html draggable list

See Demo And Download

Official Website(nobleclem): Click Here

This superior jQuery/javascript plugin is developed by nobleclem. For extra Advanced Usages, please go to the official website.