The draggable of JQuery Easyui can be dragged

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.