jQuery in Action
310
CHAPTER 9
Prominent, powerful, and practical plugins
Table 9.3 Basic and extended options for the
droppable()
command
Name
Description
Basic options
accept
(String|Function) Specifies which draggables are suitable for dropping on the droppa-
bles. This can be a string describing a jQuery selector or a function that returns true to
specify that a draggable is acceptable. When a function is specified, it's invoked with
the candidate draggable passed as its only parameter.
bles. This can be a string describing a jQuery selector or a function that returns true to
specify that a draggable is acceptable. When a function is specified, it's invoked with
the candidate draggable passed as its only parameter.
tolerance
(String) A string value that defines how a draggable must be positioned in relation to the
droppable in order to arm the droppable. The possible values are as follow:
droppable in order to arm the droppable. The possible values are as follow:
touch
--Arms the droppable if the draggable touches the droppable, or if any part
of the draggable overlaps the droppable
pointer
--Arms the droppable if the mouse pointer enters the droppable during a
drag operation
intersect
--Arms the droppable if 50% of the draggable intersects the droppable
fit
--Arms the droppable if the draggable is completely contained within the droppable
continued on next page
Figure 9.11 As a suitable draggable moves about the page, the droppable moves
between its various states.
between its various states.