O'Reilly logo

jQuery UI 1.10: The User Interface Library for jQuery by Dan Wellman, Alex Libby

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

Configuring the draggable options

The draggable component has a wide range of configurable options, giving us a very fine degree of control over the behavior that it adds. The following table lists the options that we can manipulate to configure and control our drag elements:

Option

Default value

Used to…

addClasses

true

Add the ui-draggable class to the drag object. Set it to false to prevent this class being added.

appendTo

"parent"

Specify a container element for drag objects with a helper attached.

axis

false

Constrain drag objects to one axis of motion. Accepts the strings x and y as values, or the Boolean false.

cancel

":input, option"

Prevent certain elements from being dragged, if they match the specified ...

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