Draggable plug-ins are implemented in 2 ways
The first creates a draggable element from a tag
<div id= "DRA" class= "easyui-draggable" data-options= "handle: ' #title '" style= "width:100px;height:100px;" > <div id= "title" style= "background:red;" >draggable Elements </div></div>
The second use of JavaScript code to create draggable elements
Write HTML code First
<div id= "DRA" style= "width:100px;height:100px;" > <div id= "title" style= "background: #ccc;" >draggable Elements </div></div>
Creating draggable elements in writing JS code: loading by ID
$ (' #dra '). Draggable ({handle: ' #title ',//start draggable handling//If you need to stop dragging to set disabled to True revert:true,//Drag to return to start position Proxy:functio N (source) {//Create proxy object var p = $ (' <div style= "border:1px solid #ccc; width:80px" ></div> "); p.html (source). HTML ()). AppendTo (' body '); return p; };});
This article is from the "Lao Niu Java" blog, please be sure to keep this source http://liuyj.blog.51cto.com/2340749/1590855
The draggable of JQuery Easyui can be dragged