AlexMorley-Finch AlexMorley-Finch - 12 days ago 6
jQuery Question

jQuery UI Draggable Not Working

Ive included the jquery library, afterwards the jquery UI library, and it stillDoesnt work. Using Chrome

code Follows:

<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.16.custom.min.js" type="type/javascript"></script>
<script type="text/javascript">
$(function() {
$( ".drag" ).draggable();
});
</script>

<div id="aboutBox" class="boxLook boxBg drag"></div>


??? Cant find any solutions anywhere. The debugger says that the method draggable doesnt exist. But ive added jquery AND jquery ui, and the paths are correct! it just doesnt work

Answer

You have one of these problems:

  1. Your jQuery or jQuery UI Javascript path files are wrong
  2. Your jQuery UI does not include draggable
  3. Your jQuery or jQuery UI Javascript files are corrupted
  4. Your div is unstyled and empty, therefore there is nothing to drag
  5. Something is colliding with your jQuery or jQuery UI so it doesn't work

Your code is correct, and it should work:

http://jsfiddle.net/u7zWA/