THEMETRIAL

Draggable List Sorter In Vanilla JavaScript – Sorter

Author:alsolovyev
Views Total:0 views
Official Page:Go to website
Last Update:June 9, 2021
License:MIT

Preview:

Draggable List Sorter In Vanilla JavaScript – Sorter

Description:

Sorter is a tiny sortable JavaScript library that allows drag & drop sorting of list items.

How to use it:

1. Install & download.

# NPM
$ npm i @alsolovyev/sorter --save

2. Import the Sorter’s JavaScript into the document.

<script src="https://www.cssscript.com/dist/sorter.min.js"></script>
// OR
import Sorter from '@alsolovyev/sorter'

3. Initialize the sorter on your list and the library will do the rest.

<ul data-list>
  <li><span><span><i>1</i></span></span></li>
  <li><span><span><i>2</i></span></span></li>
  <li><span><span><i>3</i></span></span></li>
  <li><span><span><i>4</i></span></span></li>
  <li><span><span><i>5</i></span></span></li>
  <li><span><span><i>6</i></span></span></li>
  <li><span><span><i>7</i></span></span></li>
  <li><span><span><i>8</i></span></span></li>
</ul>


Source link

Add comment

NOTE :

All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source www.themetrial.com

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.