I've included the jquery library, afterward the jQuery UI library, and it still doesn't work. I am Using Google Chrome browser.
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>
I can't find any solutions anywhere. The debugger says that the method draggable doesn't exist. But I've added jQuery AND jQuery UI, and the paths are correct! it just doesn't work.
Draggable() Method This method allows the elements to be dragged with the help of mouse. Using jQuery UI, we can make the DOM(Document Object Model) elements to drag anywhere within the view port. This can be done by clicking on the draggable object by mouse and dragging it anywhere within the view port.
Introduction to JavaScript Drag and Drop API By default, only image and text can be draggable. To drag an image, you simply hold the mouse button down and then move it. To drag the text, you need to highlight some text and drag it in the same way as you would drag an image.
To make an object draggable set draggable=true on that element. Just about anything can be drag-enabled: images, files, links, files, or any markup on your page. Our example creates an interface to rearrange columns that have been laid out with CSS Grid.
You have one of these problems:
Your code is correct, and it should work:
http://jsfiddle.net/u7zWA/
Try this :
<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 src="js/ui/jquery.ui.draggable.js" type="type/javascript"></script>
<script type="text/javascript">
$(function() {
$( ".drag" ).draggable();
});
</script>
<div id="aboutBox" class="boxLook boxBg drag"></div>
You have to implements the draggable component to your project, and include it ! http://jqueryui.com/download
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With