To use jQuery draggable, you need to:
- Include jquery.js, jquery.ui.core.js and jquery.draggable in your page.
- Declare
<div id="item">Some content</div> - Set the width and height of your div in your css:
#item { width: 100px; height: 100px; } #item { width: 100px; height: 100px; } - Call the jQuery draggable () extension:
$('div#item').draggable();
Of course, 2 and 3 can be done together:
<div id="item" style="width: 100px; height: 100px;">Some content</div>
source share