afterMove
function ($placeholder, container, $closestItemOrContainer) { }This is executed after the placeholder has been moved. $closestItemOrContainer contains the closest item, the placeholder has been put at or the closest empty Container, the placeholder has been appended to.
containerPath
The exact css path between the container and its items, e.g. "> tbody" containerSelector
The css selector of the containers distance
Distance the mouse has to travel to start dragging delay
Time in milliseconds after mousedown until dragging should start. This option can be used to prevent unwanted drags when clicking on an element. handle
The css selector of the drag handle itemPath
The exact css path between the item and its subcontainers. It should only match the immediate items of a container. No item of a subcontainer should be matched. E.g. for ol>div>li the itemPath is "> div" itemSelector
The css selector of the items bodyClass
The class given to "body" while an item is being dragged draggedClass
The class giving to an item while being dragged isValidTarget
function ($item, container) { return true }Check if the dragged item may be inside the container. Use with care, since the search for a valid container entails a depth first search and may be quite expensive.
onCancel
function ($item, container, _super, event) { }Executed before onDrop if placeholder is detached. This happens if pullPlaceholder is set to false and the drop occurs outside a container.
onDrag
function ($item, position, _super, event) { $item.css(position) }Executed at the beginning of a mouse move event. The Placeholder has not been moved yet.
onDragStart
function ($item, container, _super, event) { $item.css({ height: $item.outerHeight(), width: $item.outerWidth() }) $item.addClass(container.group.options.draggedClass) $("body").addClass(container.group.options.bodyClass) }Called after the drag has been started, that is the mouse button is being held down and the mouse is moving. The container is the closest initialized container. Therefore it might not be the container, that actually contains the item.
onDrop
function ($item, container, _super, event) { $item.removeClass(container.group.options.draggedClass).removeAttr("style") $("body").removeClass(container.group.options.bodyClass) }Called when the mouse button is being released
onMousedown
function ($item, _super, event) { if (!event.target.nodeName.match(/^(input|select|textarea)$/i)) { event.preventDefault() return true }Called on mousedown. If falsy value is returned, the dragging will not start. Ignore if element clicked is input, select or textarea
placeholderClass
The class of the placeholder (must match placeholder option markup) placeholder
'<li class="placeholder"></li>'Template for the placeholder. Can be any valid jQuery input e.g. a string, a DOM element. The placeholder must have the class "placeholder"
pullPlaceholder
If true, the position of the placeholder is calculated on every mousemove. If false, it is only calculated when the mouse is above a container. serialize
function ($parent, $children, parentIsContainer) { var result = $.extend({}, $parent.data()) if(parentIsContainer) return [$children] else if ($children[0]){ result.children = $children }Specifies serialization of the container group. The pair $parent/$children is either container/items or item/subcontainers.
tolerance
Set tolerance while dragging. Positive values decrease sensitivity, negative values increase it.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4