Droppable Class

The jQuery UI Droppable plugin makes selected elements droppable (meaning they accept being dropped on by draggables). You can specify which (individually) or which kind of draggables each will accept. All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'): ui.draggable - current draggable element, a jQuery object. ui.helper - current draggable helper, a jQuery object ui.position - current position of the draggable helper { top: , left: } ui.offset - current absolute position of the draggable helper { top: , left: }

Namespace: SharpKit.jQuery.UI.Controls

Constructors

Name Description
Droppable(JsString, DroppableOptions) Creates a new instance of Droppable
Droppable(JsString) Creates a new instance of Droppable

Properties

Name Description
accept All draggables that match the selector will be accepted. If a function is specified, the function will be called for each draggable on the page (passed as the first argument to the function), to provide a custom filter. The function should return true if the draggable should be accepted. Default: '*' Types: Selector, Function
activate This event is triggered any time an accepted draggable starts dragging. This can be useful if you want to make the droppable 'light up' when it can be dropped on. Default: null
activeClass If specified, the class will be added to the droppable while an acceptable draggable is being dragged. Default: false
addClasses If set to false, will prevent the ui-droppable class from being added. This may be desired as a performance optimization when calling .droppable() init on many hundreds of elements. Default: true
deactivate This event is triggered any time an accepted draggable stops dragging. Default: null
drop This event is triggered when an accepted draggable is dropped 'over' (within the tolerance of) this droppable. In the callback, $(this) represents the droppable the draggable is dropped on. ui.draggable represents the draggable. Default: null
greedy If true, will prevent event propagation on nested droppables. Default: false
hoverClass If specified, the class will be added to the droppable while an acceptable draggable is being hovered. Default: false
out This event is triggered when an accepted draggable is dragged out (within the tolerance of) this droppable. Default: null
over This event is triggered as an accepted draggable is dragged 'over' (within the tolerance of) this droppable. Default: null
scope Used to group sets of draggable and droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted. Default: 'default'
tolerance Specifies which mode to use for testing whether a draggable is 'over' a droppable. Possible values: 'fit', 'intersect', 'pointer', 'touch'. fit: draggable overlaps the droppable entirely intersect: draggable overlaps the droppable at least 50% pointer: mouse pointer overlaps the droppable touch: draggable overlaps the droppable any amount Default: 'intersect'
© Copyright 2005-2011 SharpKit. All rights reserved.