Draggable using jQuery

Hi Everyone,

If you want to create draggable function using jQuery, Below code may help to you :

<style>
 #draggable { width: 150px; height: 150px; padding: 0.5em; }
 </style>
 <script>
 $(function() {
  $( "#draggable" ).draggable();
 });
 </script>



<div class="demo">

<div id="draggable" class="ui-widget-content">
 <p>Drag me around</p>
</div>

</div><!-- End demo -->



<div style="display: none;" class="demo-description">
<p>Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.</p>
</div><!-- End demo-description -->

No comments:

Post a Comment