jquery-swapable


The jQuery UI Swapable plugin makes selected elements swapable by dragging with the mouse.

The jQuery UI Swapable plugin makes selected elements swappable by dragging with the mouse.

Introduction

Enable a group of DOM elements to be swappable. Click on and drag an element to a new spot within the list; drag element and drop one will swap and the other items will not affected. By default, swapable items share sortable properties.

Details

Similar to "Sortable", but only two elements of the selected group are affected: dragged and dropped which are swapped. All other elements stay at their current positions. This plugin is built based on existing "Sortable" jQuery plugin and inherits all sortable options except "cursorAt" one which is hard-coded.

Based on jquery.ui.sortable.js

Depends:

jquery.ui.core.js
jquery.ui.mouse.js
jquery.ui.widget.js
jquery.ui.sortable.js

To add the feature to a group of elements:

Minimal configuration: ```

$("#swappable").swappable({ items: '.itemClass', cursorAt: {top:-10} }); ```

Add this statement (optional) to disable unwilling text selection $("#swapable").disableSelection();

Live demo and documentation:

http://www.eslinstructor.net/demo/swappable/swappable_home.html

Project Information

Labels:
swapable swappable jquerysortable jqueryswappable sortable