Advanced touch-compatible Drag'n'Drop library providing Draggable, Droppable and Sortable for Zepto.js and jQuery
Prevents dragging from starting on specified elements.
$('#example-cancel').draggable({ cancel: '.title' })
$('.draggable-clone').draggable({ clone: true })
$('.draggable-cloneFn').draggable({
clone: function() { return this.clone() }
})
Specifies a class that will be added to cloned draggables.
$('.draggable-cloneClass').draggable({ clone: true, cloneClass: 'clone' })
Allows the draggable to be dropped onto the specified sortables. If this option is used, a draggable can be dropped onto a sortable list and then becomes part of it.
$('#list').sortable()
.on('sortable:receive', function(e, ui) {
ui.item.removeClass('draggable')
})
$('#example-sortable .draggable').draggable({
connectWith: '#list'
})
Disables the draggable if set to true
.
$('#example-disabled').draggable({ disabled: true })
If specified, restricts dragging from starting to the specified element(s). Only elements that descend from the draggable element are permitted.
$('#example-handle').draggable({ handle: '.title' })
Used to group sets of draggable and droppable items, in addition to the accept option. A draggable with the same scope value as a droppable will be accepted.
$('#example-scope').draggable({ scope: 'T' })
Removes the draggable functionality completely.
$('#example-destroy').draggable()
$('#example-destroy').draggable('destroy')
Disables the draggable.
$('#example-disable').draggable('disable')
Enables the draggable.
$('#example-enable').draggable('enable')
Gets an object containing key/value pairs representing the current draggable options hash.
var options = $('#example-option').draggable('option')
Gets the value currently associated with the specified optionName
.
var isDisabled = $('#example-option').draggable('option', 'disabled')
Sets the value of the draggable option associated with the specified optionName
.
$('#example-option').draggable('option', 'disabled', true)
Sets one or more options for the draggable.
$('#example-option').draggable('option', { disabled: true })
Triggered when the droppable is created.
This event is triggered when dragging starts.
This event is triggered when dragging has stopped.