Drag and drop div using jquery
I got a Main Div where i can drop any text and this will be displayed as in a form shown in the below script.
I need to drag and 开发者_StackOverflowdrop the dynamically generated div to move it up or down ,from within the current div. Is this possible?
<script type="text/javascript">
$(init);
function init() {
function addColumn(column)
{
var iHtml;
//Labeling and Tool Tip the Checkbox
iHtml = "<div id='<%" + column + ".ClientID%>'><span title='ToolTipText'>"+
"<input id='<%" + column + ".ClientID%>' type='checkbox' name='<%" + column + ".ClientID %>' />"+
"<label for='<%" + column + ".ClientID%>'>MyCheckBox</label></span></div>";
return iHtml
}
}
http://jqueryui.com/demos/draggable/
http://jqueryui.com/demos/droppable/
Check out jQuery ui. There are draggable/dropable and sortable plugins
精彩评论