JQuery UI Library Draggable

From WikiOD

Simple Example[edit | edit source]

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[edit | edit source]

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

Credit:Stack_Overflow_Documentation