jQuery UI Library

Draggable

Simple Example

Enable draggable functionality on any DOM element.

<script>
  $(function() {
    $( "#draggable" ).draggable();
  });
</script>
<div id="draggable" class="ui-widget-content">
  <p>Drag me around</p>
</div>

Draggable with handle

You can use any element as an handle to drag another element around:

<script>
  $(function() {
      $( "#draggable" ).draggable({
         handle: ".handle"
      });
  });
</script>
<div id="draggable">
    <span class="handle">Handle</span>
    <div>Content</div>
</div>

Fiddle


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow