_bind_names
_asgns
name_subpath
traverse_subpath
_text

\n <ul class="UIAPIPlugin-toc">\n <li><a href="#overview">Overview</a></li>\n <li><a href="#options">Options</a></li>\n <li><a href="#events">Events</a></li>\n <li><a href="#methods">Methods</a></li>\n <li><a href="#theming">Theming</a></li>\n </ul>\n <div class="UIAPIPlugin">\n <h1>jQuery UI Draggable</h1>\n <div id="overview">\n <h2 class="top-header">Overview</h2>\n <div id="overview-main">\n <p>The jQuery UI Draggable plugin makes selected elements draggable by mouse.</p>\n <p>Draggable elements gets a class of <code>ui-draggable</code>. During drag the element also gets a class of <code>ui-draggable-dragging</code>. If you want not just drag, but drag-and-drop, see the jQuery UI Droppable plugin, which provides a drop target for draggables.</p>\n <p>All callbacks (start, stop, drag) 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\'):</p>\n <ul>\n <li><b>ui.helper</b> - the jQuery object representing the helper that\'s being dragged</li>\n <li><b>ui.position</b> - current position of the helper as { top, left } object, relative to the offset element</li>\n <li><b>ui.offset</b> - current absolute position of the helper as { top, left } object, relative to page</li>\n </ul>\n </div>\n <div id="overview-dependencies">\n <h3>Dependencies</h3>\n <ul>\n <li>UI Core</li>\n </ul>\n </div>\n <div id="overview-example">\n <h3>Example</h3>\n <div id="overview-example" class="example">\n <ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>\n <p><div id="demo" class="tabs-container" rel="170">\n Initialize a draggable with default options.<br />\n </p>\n <pre>$(&quot;#draggable&quot;).draggable();\n </pre>\n <p></div><div id="source" class="tabs-container">\n </p>\n <pre>&lt;!DOCTYPE html&gt;\n &lt;html&gt;\n &lt;head&gt;\n &lt;link type=&quot;text/css&quot; href=&quot;http://jqueryui.com/latest/themes/base/ui.all.css&quot; rel=&quot;stylesheet&quot; /&gt;\n &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/jquery-1.3.2.js&quot;&gt;&lt;/script&gt;\n &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.core.js&quot;&gt;&lt;/script&gt;\n &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.draggable.js&quot;&gt;&lt;/script&gt;\n &lt;style type=&quot;text/css&quot;&gt;\n #draggable { width: 100px; height: 70px; background: silver; }\n &lt;/style&gt;\n &lt;script type="text/javascript"&gt;\n $(document).ready(function(){\n $(&quot;#draggable&quot;).draggable();\n });\n &lt;/script&gt;\n &lt;/head&gt;\n &lt;body style="font-size:62.5%;"&gt;\n \n &lt;div id=&quot;draggable&quot;&gt;Drag me&lt;/div&gt;\n \n &lt;/body&gt;\n &lt;/html&gt;\n </pre>\n <p></div>\n </p><p></div>\n </div>\n </div>\n <div id="options">\n <h2 class="top-header">Options</h2>\n <ul class="options-list">\n \n <li class="option" id="option-addClasses">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-addClasses">addClasses</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">true</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If set to false, will prevent the <code>ui-draggable</code> class from being added. This may be desired as a performance optimization when calling <code>.draggable()</code> init on many hundreds of elements.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>addClasses</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ addClasses: false });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>addClasses</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var addClasses = $(\'.selector\').draggable(\'option\', \'addClasses\');\n //setter\n $(\'.selector\').draggable(\'option\', \'addClasses\', false);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-appendTo">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-appendTo">appendTo</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Element, Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\'parent\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>The element passed to or selected by the <code>appendTo</code> option will be used as the draggable helper\'s container during dragging. By default, the helper is appended to the same container as the draggable.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>appendTo</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ appendTo: \'body\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>appendTo</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var appendTo = $(\'.selector\').draggable(\'option\', \'appendTo\');\n //setter\n $(\'.selector\').draggable(\'option\', \'appendTo\', \'body\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-axis">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-axis">axis</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">String</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values: \'x\', \'y\'.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>axis</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ axis: \'x\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>axis</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var axis = $(\'.selector\').draggable(\'option\', \'axis\');\n //setter\n $(\'.selector\').draggable(\'option\', \'axis\', \'x\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-cancel">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-cancel">cancel</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\':input,option\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Prevents dragging from starting on specified elements.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>cancel</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ cancel: \'button\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>cancel</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var cancel = $(\'.selector\').draggable(\'option\', \'cancel\');\n //setter\n $(\'.selector\').draggable(\'option\', \'cancel\', \'button\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-connectToSortable">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-connectToSortable">connectToSortable</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Allows the draggable to be dropped onto the specified sortables. If this option is used (<code>helper</code> must be set to \'clone\' in order to work flawlessly), a draggable can be dropped onto a sortable list and then becomes part of it.\n </p><p>Note: Specifying this option as an array of selectors has been removed.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>connectToSortable</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ connectToSortable: \'ul#myList\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>connectToSortable</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var connectToSortable = $(\'.selector\').draggable(\'option\', \'connectToSortable\');\n //setter\n $(\'.selector\').draggable(\'option\', \'connectToSortable\', \'ul#myList\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-containment">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-containment">containment</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Selector, Element, String, Array</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Constrains dragging to within the bounds of the specified element or region. Possible string values: \'parent\', \'document\', \'window\', [x1, y1, x2, y2].</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>containment</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ containment: \'parent\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>containment</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var containment = $(\'.selector\').draggable(\'option\', \'containment\');\n //setter\n $(\'.selector\').draggable(\'option\', \'containment\', \'parent\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-cursor">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-cursor">cursor</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">String</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\'auto\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>The css cursor during the drag operation.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>cursor</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ cursor: \'crosshair\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>cursor</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var cursor = $(\'.selector\').draggable(\'option\', \'cursor\');\n //setter\n $(\'.selector\').draggable(\'option\', \'cursor\', \'crosshair\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-cursorAt">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-cursorAt">cursorAt</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Object</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Moves the dragging helper so the cursor always appears to drag from the same position. Coordinates can be given as a hash using a combination of one or two keys: <code>{ top, left, right, bottom }</code>.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>cursorAt</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ cursorAt: { left: 5 } });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>cursorAt</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var cursorAt = $(\'.selector\').draggable(\'option\', \'cursorAt\');\n //setter\n $(\'.selector\').draggable(\'option\', \'cursorAt\', { left: 5 });</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-delay">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-delay">delay</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">0</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Time in milliseconds after mousedown until dragging should start. This option can be used to prevent unwanted drags when clicking on an element.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>delay</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ delay: 500 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>delay</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var delay = $(\'.selector\').draggable(\'option\', \'delay\');\n //setter\n $(\'.selector\').draggable(\'option\', \'delay\', 500);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-distance">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-distance">distance</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">1</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Distance in pixels after mousedown the mouse must move before dragging should start. This option can be used to prevent unwanted drags when clicking on an element.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>distance</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ distance: 30 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>distance</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var distance = $(\'.selector\').draggable(\'option\', \'distance\');\n //setter\n $(\'.selector\').draggable(\'option\', \'distance\', 30);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-grid">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-grid">grid</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Array</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Snaps the dragging helper to a grid, every x and y pixels. Array values: [x, y]</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>grid</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ grid: [50, 20] });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>grid</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var grid = $(\'.selector\').draggable(\'option\', \'grid\');\n //setter\n $(\'.selector\').draggable(\'option\', \'grid\', [50, 20]);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-handle">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-handle">handle</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Element, Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If specified, restricts drag start click to the specified element(s).</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>handle</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ handle: \'h2\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>handle</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var handle = $(\'.selector\').draggable(\'option\', \'handle\');\n //setter\n $(\'.selector\').draggable(\'option\', \'handle\', \'h2\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-helper">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-helper">helper</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">String, Function</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\'original\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Allows for a helper element to be used for dragging display. Possible values: \'original\', \'clone\', Function. If a function is specified, it must return a DOMElement.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>helper</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ helper: \'clone\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>helper</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var helper = $(\'.selector\').draggable(\'option\', \'helper\');\n //setter\n $(\'.selector\').draggable(\'option\', \'helper\', \'clone\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-iframeFix">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-iframeFix">iframeFix</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean, Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Prevent iframes from capturing the mousemove events during a drag. Useful in combination with cursorAt, or in any case, if the mouse cursor is not over the helper. If set to true, transparent overlays will be placed over all iframes on the page. If a selector is supplied, the matched iframes will have an overlay placed over them.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>iframeFix</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ iframeFix: true });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>iframeFix</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var iframeFix = $(\'.selector\').draggable(\'option\', \'iframeFix\');\n //setter\n $(\'.selector\').draggable(\'option\', \'iframeFix\', true);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-opacity">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-opacity">opacity</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Float</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Opacity for the helper while being dragged.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>opacity</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ opacity: 0.35 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>opacity</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var opacity = $(\'.selector\').draggable(\'option\', \'opacity\');\n //setter\n $(\'.selector\').draggable(\'option\', \'opacity\', 0.35);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-refreshPositions">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-refreshPositions">refreshPositions</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If set to true, all droppable positions are calculated on every mousemove. Caution: This solves issues on highly dynamic pages, but dramatically decreases performance.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>refreshPositions</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ refreshPositions: true });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>refreshPositions</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var refreshPositions = $(\'.selector\').draggable(\'option\', \'refreshPositions\');\n //setter\n $(\'.selector\').draggable(\'option\', \'refreshPositions\', true);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-revert">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-revert">revert</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean, String</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If set to true, the element will return to its start position when dragging stops. Possible string values: \'valid\', \'invalid\'. If set to invalid, revert will only occur if the draggable has not been dropped on a droppable. For valid, it\'s the other way around.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>revert</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ revert: true });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>revert</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var revert = $(\'.selector\').draggable(\'option\', \'revert\');\n //setter\n $(\'.selector\').draggable(\'option\', \'revert\', true);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-revertDuration">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-revertDuration">revertDuration</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">500</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>The duration of the revert animation, in milliseconds. Ignored if revert is false.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>revertDuration</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ revertDuration: 1000 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>revertDuration</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var revertDuration = $(\'.selector\').draggable(\'option\', \'revertDuration\');\n //setter\n $(\'.selector\').draggable(\'option\', \'revertDuration\', 1000);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-scope">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-scope">scope</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">String</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\'default\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>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 by the droppable.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>scope</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ scope: \'tasks\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>scope</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var scope = $(\'.selector\').draggable(\'option\', \'scope\');\n //setter\n $(\'.selector\').draggable(\'option\', \'scope\', \'tasks\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-scroll">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-scroll">scroll</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">true</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If set to true, container auto-scrolls while dragging.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>scroll</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ scroll: false });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>scroll</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var scroll = $(\'.selector\').draggable(\'option\', \'scroll\');\n //setter\n $(\'.selector\').draggable(\'option\', \'scroll\', false);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-scrollSensitivity">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-scrollSensitivity">scrollSensitivity</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">20</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Distance in pixels from the edge of the viewport after which the viewport should scroll. Distance is relative to pointer, not the draggable.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>scrollSensitivity</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ scrollSensitivity: 40 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>scrollSensitivity</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var scrollSensitivity = $(\'.selector\').draggable(\'option\', \'scrollSensitivity\');\n //setter\n $(\'.selector\').draggable(\'option\', \'scrollSensitivity\', 40);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-scrollSpeed">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-scrollSpeed">scrollSpeed</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">20</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>The speed at which the window should scroll once the mouse pointer gets within the <code>scrollSensitivity</code> distance.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>scrollSpeed</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ scrollSpeed: 40 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>scrollSpeed</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var scrollSpeed = $(\'.selector\').draggable(\'option\', \'scrollSpeed\');\n //setter\n $(\'.selector\').draggable(\'option\', \'scrollSpeed\', 40);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-snap">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-snap">snap</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Boolean, Selector</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>If set to a selector or to true (equivalent to \'.ui-draggable\'), the draggable will snap to the edges of the selected elements when near an edge of the element.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>snap</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ snap: true });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>snap</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var snap = $(\'.selector\').draggable(\'option\', \'snap\');\n //setter\n $(\'.selector\').draggable(\'option\', \'snap\', true);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-snapMode">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-snapMode">snapMode</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">String</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">\'both\'</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Determines which edges of snap elements the draggable will snap to. Ignored if snap is false. Possible values: \'inner\', \'outer\', \'both\'</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>snapMode</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ snapMode: \'outer\' });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>snapMode</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var snapMode = $(\'.selector\').draggable(\'option\', \'snapMode\');\n //setter\n $(\'.selector\').draggable(\'option\', \'snapMode\', \'outer\');</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-snapTolerance">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-snapTolerance">snapTolerance</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">20</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>The distance in pixels from the snap element edges at which snapping should occur. Ignored if snap is false.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>snapTolerance</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ snapTolerance: 40 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>snapTolerance</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var snapTolerance = $(\'.selector\').draggable(\'option\', \'snapTolerance\');\n //setter\n $(\'.selector\').draggable(\'option\', \'snapTolerance\', 40);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-stack">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-stack">stack</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Object</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>Controls the z-Index of the defined group (key \'group\' in the hash, accepts jQuery selector) automatically, always brings to front the dragged item. Very useful in things like window managers. Optionally, a \'min\' key can be set, so the zIndex cannot go below that value.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>stack</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ stack: { group: \'products\', min: 50 } });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>stack</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var stack = $(\'.selector\').draggable(\'option\', \'stack\');\n //setter\n $(\'.selector\').draggable(\'option\', \'stack\', { group: \'products\', min: 50 });</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="option" id="option-zIndex">\n <div class="option-header">\n <h3 class="option-name"><a href="#option-zIndex">zIndex</a></h3>\n <dl>\n <dt class="option-type-label">Type:</dt>\n <dd class="option-type">Integer</dd>\n \n <dt class="option-default-label">Default:</dt>\n <dd class="option-default">false</dd>\n \n </dl>\n </div>\n <div class="option-description">\n <p>z-index for the helper while being dragged.</p>\n </div>\n <div class="option-examples">\n <h4>Code examples</h4>\n <dl class="option-examples-list">\n \n <dt>\n Initialize a draggable with the <code>zIndex</code> option specified.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({ zIndex: 2700 });</code></pre>\n </dd>\n \n \n <dt>\n Get or set the <code>zIndex</code> option, after init.\n </dt>\n <dd>\n <pre><code>//getter\n var zIndex = $(\'.selector\').draggable(\'option\', \'zIndex\');\n //setter\n $(\'.selector\').draggable(\'option\', \'zIndex\', 2700);</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n </ul>\n </div>\n <div id="events">\n <h2 class="top-header">Events</h2>\n <ul class="events-list">\n \n <li class="event" id="event-start">\n <div class="event-header">\n <h3 class="event-name"><a href="#event-start">start</a></h3>\n <dl>\n <dt class="event-type-label">Type:</dt>\n <dd class="event-type">dragstart</dd>\n </dl>\n </div>\n <div class="event-description">\n <p>This event is triggered when dragging starts.</p>\n </div>\n <div class="event-examples">\n <h4>Code examples</h4>\n <dl class="event-examples-list">\n \n <dt>\n Supply a callback function to handle the <code>start</code> event as an init option.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({\n start: function(event, ui) { ... }\n });</code></pre>\n </dd>\n \n \n <dt>\n Bind to the <code>start</code> event by type: <code>dragstart</code>.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').bind(\'dragstart\', function(event, ui) {\n ...\n });</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="event" id="event-drag">\n <div class="event-header">\n <h3 class="event-name"><a href="#event-drag">drag</a></h3>\n <dl>\n <dt class="event-type-label">Type:</dt>\n <dd class="event-type">drag</dd>\n </dl>\n </div>\n <div class="event-description">\n <p>This event is triggered when the mouse is moved during the dragging.</p>\n </div>\n <div class="event-examples">\n <h4>Code examples</h4>\n <dl class="event-examples-list">\n \n <dt>\n Supply a callback function to handle the <code>drag</code> event as an init option.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({\n drag: function(event, ui) { ... }\n });</code></pre>\n </dd>\n \n \n <dt>\n Bind to the <code>drag</code> event by type: <code>drag</code>.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').bind(\'drag\', function(event, ui) {\n ...\n });</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n \n <li class="event" id="event-stop">\n <div class="event-header">\n <h3 class="event-name"><a href="#event-stop">stop</a></h3>\n <dl>\n <dt class="event-type-label">Type:</dt>\n <dd class="event-type">dragstop</dd>\n </dl>\n </div>\n <div class="event-description">\n <p>This event is triggered when dragging stops.</p>\n </div>\n <div class="event-examples">\n <h4>Code examples</h4>\n <dl class="event-examples-list">\n \n <dt>\n Supply a callback function to handle the <code>stop</code> event as an init option.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').draggable({\n stop: function(event, ui) { ... }\n });</code></pre>\n </dd>\n \n \n <dt>\n Bind to the <code>stop</code> event by type: <code>dragstop</code>.\n </dt>\n <dd>\n <pre><code>$(\'.selector\').bind(\'dragstop\', function(event, ui) {\n ...\n });</code></pre>\n </dd>\n \n </dl>\n </div>\n </li>\n \n </ul>\n </div>\n <div id="methods">\n <h2 class="top-header">Methods</h2>\n <ul class="methods-list">\n \n <li class="method" id="method-destroy">\n <div class="method-header">\n <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>\n <dl>\n <dt class="method-signature-label">Signature:</dt>\n <dd class="method-signature">.draggable( \'destroy\'\n \n \n \n \n \n \n \n )</dd>\n </dl>\n </div>\n <div class="method-description">\n <p>Remove the draggable functionality completely. This will return the element back to its pre-init state.</p>\n </div>\n </li>\n \n \n <li class="method" id="method-disable">\n <div class="method-header">\n <h3 class="method-name"><a href="#method-disable">disable</a></h3>\n <dl>\n <dt class="method-signature-label">Signature:</dt>\n <dd class="method-signature">.draggable( \'disable\'\n \n \n \n \n \n \n \n )</dd>\n </dl>\n </div>\n <div class="method-description">\n <p>Disable the draggable.</p>\n </div>\n </li>\n \n \n <li class="method" id="method-enable">\n <div class="method-header">\n <h3 class="method-name"><a href="#method-enable">enable</a></h3>\n <dl>\n <dt class="method-signature-label">Signature:</dt>\n <dd class="method-signature">.draggable( \'enable\'\n \n \n \n \n \n \n \n )</dd>\n </dl>\n </div>\n <div class="method-description">\n <p>Enable the draggable.</p>\n </div>\n </li>\n \n \n <li class="method" id="method-option">\n <div class="method-header">\n <h3 class="method-name"><a href="#method-option">option</a></h3>\n <dl>\n <dt class="method-signature-label">Signature:</dt>\n <dd class="method-signature">.draggable( \'option\'\n \n , optionName\n \n , <span class="optional">[</span>value<span class="optional">] </span>\n \n \n \n )</dd>\n </dl>\n </div>\n <div class="method-description">\n <p>Get or set any draggable option. If no value is specified, will act as a getter.</p>\n </div>\n </li>\n \n \n </ul>\n </div>\n <div id="theming">\n <h2 class="top-header">Theming</h2>\n <p>The jQuery UI Draggable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.\n </p>\n <p>If a deeper level of customization is needed, there are widget-specific classes referenced within the ui.draggable.css stylesheet that can be modified. These classes are highlighed in bold below.\n </p>\n \n <h3>Sample markup with jQuery UI CSS Framework classes</h3>\n &lt;div class=&quot;<strong>ui-draggable</strong>&quot;&gt;&lt;/div&gt;\n <p class="theme-note">\n <strong>\n Note: This is a sample of markup generated by the draggable plugin, not markup you should use to create a draggable. The only markup needed for that is &lt;div&gt;&lt;/div&gt;.\n </strong>\n </p>\n \n </div>\n </div>\n \n </p><!-- \n Pre-expand include size: 55070 bytes\n Post-expand include size: 98892 bytes\n Template argument size: 56660 bytes\n Maximum: 2097152 bytes\n -->\n \n <!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3340-1!1!0!!en!2 and timestamp 20090604112209 -->\n

id
draggable.html
output_encoding
utf-8