tags:

views:

43

answers:

3

Hi all,

I am doing some self-learning about JQuery. Here is the code for my very simple HTML form:

    <html>
         <head>
    <script type="text/javascript" 
    src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
            </head>
            <body>
            <script type="text/javascript">
                $(document).ready(function(){
                    $("#replybox").draggable();
                });
            </script>
            <div id="replybox">
            <form>
            <table border="2">       
            <tr>
            <td align="center">
<textarea name="data[Test][quote]" id="data[Test][quote]" rows="18"></textarea>
            </td>
            </tr>
            </table>
            </form>
            </div>
            </body>
            </html>

The DIV table just could not be draggable,
I am not sure what's wrong in the code.
Any ideas?

+4  A: 

it looks like you're trying to use the jQueryUI framework. .draggable() is not natively jQuery --- the jQueryUI (plugin) adds that functionality in. jQueryUI Home

Alternatively, you can also link directly to the jQueryUI instance in GoogleAPIs.

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js'&gt;&lt;/script&gt;

But personally, I prefer to build my own download package from their home page, especially if all you need is .draggable().

Richard Neil Ilagan
+2  A: 

You just need the jQuery UI plugin. See here: http://jqueryui.com/demos/draggable/

mattmc3
+3  A: 

Draggable is part of the jquery UI which is not directly part of jQuery.

http://jqueryui.com/demos/draggable/

AeroJoe
Seems some ppl have beat me to the punch.
AeroJoe
I'll vote you up. Not fair to not share the credit, especially with another jQuery geek!
mattmc3
I def agree. :)
Richard Neil Ilagan