O'Reilly logo

Beginning JavaScript® and CSS Development with jQuery by Richard York

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix J. Draggables and Droppables

Draggable and Droppable Methods

Method

Description

Return Value

draggable(options)

Makes the selected element(s) draggable. Options can be specified by passing an object literal as the first argument using key, value pairs. For a complete list of options, see the "Draggables Options" section later in this Appendix.

jQuery

draggable('disable')

Disables draggable functionality on the selected element(s).

jQuery

draggable('enable')

Enables draggable functionality on the selected element(s).

jQuery

draggable('destroy')

Completely removes draggable functionality from the selected element(s).

jQuery

droppable(options)

Makes the selected element(s) droppable. Options can be specified by passing an object literal as the first argument using key, value pairs. For a complete list of options, see the "Droppable Options" section later in this Appendix.

Dropset

droppable('disable')

Disables droppable functionality on the selected element(s).

jQuery

droppable('enable')

Enables droppable functionality on the selected element(s).

jQuery

droppable('destroy')

Completely removes droppable functionality from the selected element(s).

jQuery

Draggables Options

Option

Description

Type

appendTo

For a draggable with a helper option specified, the matched element passed to the appendTo option will be used as the helper's container. If not specified, the helper is appended to the same container as the draggable.

Element, Selector

axis

Contains dragging to an X- or Y-axis. Defaults to false.

String

cancel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required