The JQueryUIDraggable plug-in allows you to drag selected elements with the mouse. the element of Draggable is affected by css: ui-draggable. css: ui-draggable-dragging during the drag process. if you need a complete drag-and-drop function, see the Droppable plug-in of JQueryUI.
The JQuery UI Draggable plugin enables y
Easyui as a package of Jqusey UI plug-ins, in fact, it is good to use, at least save a lot of time like me slag.
Draggable can be loaded in two ways:
1, loaded by class, as follows:
Loaded through JS, as follows:
$ (' #box '). draggable ();
The above two points to note is whether the ' easyui-draggable ', or
HTML5 draggable Properties:This property specifies whether the element can be dragged.Links and images are draggable by default.Syntax structure:draggable= "True|false|auto">Browser support:(1). IE8 above browsers support this property.(2). This property is supported by Google Chrome.(3). Firefox supports this property.(4). This property is supported by the Safari browser.(5). This property is supported by
Draggable plug-ins are implemented in 2 waysThe first creates a draggable element from a tagThe second use of JavaScript code to create draggable elementsWrite HTML code FirstCreating draggable elements in writing JS code: loading by ID$ (' #dra '). Draggable ({handle: ' #ti
Snap-):
JQuery ("# draggable1"). draggable ({snap: true });//Default, adsorption in any wayJQuery ("# draggable2"). draggable ({snap: "# snaptarget "});//Adsorption with the inner and outer diameter of an elementJQuery ("# draggable3"). draggable ({snap: "# snaptarget", snapMode: "outer "});//Adsorption with the outer diameter of an element. The adsorption method
The main purpose of this example is to use the draggable control of jquey.
Jquery, jquery-ui, and draggable are referenced in sequence. Then write the correspondingCodeFor more information about the code, seeProgram.
For draggable instructions, see: http://docs.jquery.com/UI/API/1.8/Draggable
Source code:Downl
Learning Essentials:1. Loading mode2. List of properties3. Event List4. Method ListThis section focuses on how to use the draggable (drag) component in Easyui, which is not dependent on other components.A Load modeClass load mode This way looks like HTML code is not clean and can pollute HTML. It is recommended to use JS method to loadDOCTYPE HTML>HTML>Head>title>JQuery Easy UItitle>MetaCharSet= "UTF-8" />Scripttype= "Text/javascript"src= "Easyui/jque
To give an example:How to use:$ ("#draggable"). Draggable ();Note: Add jquery and Jquery-ui to two class libraries before using.Note: jquery 2.0 and above do not support IE6 7 8, so you want to let the browser support the contents of the plugin, please use the following version of jquery2.0.(a) explanation of specific parameters:1 zindex:100//Indicates the drag of the drag when the label plus the Z-index va
DescriptionConstrain the movement of each draggable by defining the boundaries of the draggable area. Set axis options to limit the path of the draggable to the x-axis or y-axisExampleOutput650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8D/A8/wKiom1ilIWDglf0tAABHCOX7jfc224.png-wh_500x0-wm_ 3-wmp_4-s_3449905222.png "title=" Qq20170216114915.png "alt="
Yesterday, we introduced a beautiful example of a draggable div based on the jquery UI, and today we are going to share a draggable div that is based on jquery. This draggable div is just a reference to jquery, without the need to reference the jquery UI. The coordinates of the mouse are also recorded in real time. Let's see it together.Online preview Source Down
Overrides the default defaults with $.fn.draggable.defaults.
Usage
Copy Code code as follows:
Copy Code code as follows:
$ (' #dd '). Draggable ({
Handle: ' #title '
});
Characteristics
Name
Type
Description
Default value
Proxy
String,function
The proxy element to use when dragging, when set to ' clone ' , the clone element will be used as the proxy. If you
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.