Do I need another JQuery plugin for Draggable to work?
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"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#replybox").draggable();
});
</script>
<d开发者_C百科iv 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?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'></script>
But personally, I prefer to build my own download package from their home page, especially if all you need is .draggable().
Draggable is part of the jquery UI which is not directly part of jQuery.
http://jqueryui.com/demos/draggable/
You just need the jQuery UI plugin. See here: http://jqueryui.com/demos/draggable/
精彩评论