If you constrain a div's draggable range to a specified element:Drag effect everyone may be familiar with, but usually the drag range is limited, through an example code to explain how to drag a div to a specified range of elements, code example is as follows:DOCTYPE HTML> HTML> Head> MetaCharSet= "Utf-8"> Metaname= "Author"content= "http://www.softwhy.com/" /> title>Ant Tribetitle> styletype= "Text/css">#box{width:400px;Height:300px;Background-color:
Definition and usageReturns Draggable (or its assistant) to the original position when draggable with the boolean revert option stops draggingExampleOutput650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8D/A8/wKioL1ilXPiyGD3DAAALC6MJGDM208.png-wh_500x0-wm_ 3-wmp_4-s_3325224465.png "title=" Qq20170216160332.png "alt=" Wkiol1ilxpiygd3daaalc6mjgdm208.png-wh_50 "/>This article is from the "Yan" blog
As mentioned above, the JQuery Easyui plugin reference is generally used in two ways (excluding the Easyload loading method), so the draggable component to be summarized in this article is also loaded in two ways:(1), using the class load mode:Content section(2), JS load call$ (' #box '). draggable ();Also mentioned above, the use of the class attribute is not conducive to the expansion of other properties
Draggable (drag) ComponentLearning Essentials:1. Loading mode2. List of properties3. Event List4. Method ListThis lesson focuses on the use of the draggable (drag) component in easyui, which does not depend on other Components.A Load mode//class Load Mode id= "box" classstyle= "width:400px;height:200px; background:red; " > Content Section Div >JS Load Call $ (' #box ').
Objectvar Originaleventobject = $ (this). Data (' EventObject ');We need to copy it, so that multiple events don ' t has a reference to the same objectvar copiedeventobject = $.extend ({}, Originaleventobject);Assign it the date that is reportedCopiedeventobject.start = date;Copiedeventobject.allday = AllDay;Copiedeventobject.classname = $ (this). attr ("Data-class");$.post ($. U (' calendar/ajax?q=addevent '), {' Addevent ': copiedeventobject},function (data) {Console.log (Copiedeventobject);}
screen in horizontal and vertical directions, and is usually used to determine whether the sliding distance is valid.The 3.Layout (int left,int top,int Right,int bottom) method is used to control the location of the view.This method is the key to make the view move, to correctly calculate the value of the left top right bottom, usually with the value of the previous state (1 of the four methods) plus in the horizontal or vertical direction to move the distance can beWith a general understanding
Definition and usagePositions the cursor when dragging the object. By default, the cursor appears in the middle of the dragged object. Use the Cursorat option to specify a different location relative to draggable (specify a pixel value relative to top, right, bottom, left). Customize the appearance of the cursor by providing a cursor option with a valid CSS cursor valueExampleOutput650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8D/A9/wKio
Draggable Panels Bootstrap Test If you are using a Bootstrap panel, pay serious attention to class = row and class = Col-.... Wait for nesting, otherwise the sort will go wrong! But if it was written by itself like panel panels within the effect can not consider this, I just Eat dead row and Col loss, at first did not notice, studied for several hours finally succeeded, because of row and col problem, when we use various frameworks, Especially the fro
Today we are going to bring you a nice draggable div instance that is based on the jquery UI. This example uses the image as the background, the DIV layer uses the ghost transparency effect. Div Drag is based on the jquery UI. The interface is very beautiful. Look together:Online preview Source DownloadThe implemented code.HTML code: DivID= "Box1"class= "box BLURRED-BG tinted"> H1>Blurred BackgroundH1> H2> byahref= "Http://www.w2bc.co
element to be dragged. Initially I added the "ui-widget-content" category to all the elements to be dragged. However, test the drag result and find that the element can only be dragged in the container it is in, and then drag to the right, and the div will appear with horizontal or vertical scroll bars. I don't know if I'm on the wrong set of parameters. Container set the Overflow:auto.The effect is shown in the following illustration:Because the end of the left element node is the AJAX access
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: Copy c
JQuery Easy UI Draggable (drag) Component
As mentioned above, jQuery EasyUI plug-in references are usually used in two ways (excluding the easyload Loading Method). Therefore, the Draggable component to be summarized in this article also has two loading methods:
(1) Use the class loading method:
Content
(2) JS loading and calling
$ ('# Box'). draggable ();
As men
Definition and usageConstrain the motion of each draggable by defining the boundaries of the draggable area, using the containment option to specify a DOM element of a parent or a jQuery selectorExampleOutput650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8D/A6/wKioL1ilOvWTCghMAABERjHsyIc656.png-wh_500x0-wm_ 3-wmp_4-s_1144824128.png "title=" Qq20170216133825.png "alt=" Wkiol1ilovwtcghmaaberjhsyi
Definition and usageDrag is only allowed when the cursor is specified on the draggable. Use the handle option to specify the JQuery selector for the element (or group of elements) that is used to drag the object, or to not allow dragging when the cursor is specified on the element (or group of elements) within the draggable. Use the Cancel option to specify a jQuery selector that cancels the drag functionEx
Jquery-ui provides us with a very handy drag-and-drop method: Draggable (), when using this method, we might want the control to move only in one area and not be dragged out of the boundary, so we can use the following method:When calling Draggable ():$ (' #element '). Draggable ({containment: ' #background '});The code above is to limit the drag range of element
fact, the concrete steps is very simple, is to upload the script file of the appendix to the document library, reference, and then in this view to initialize the table can be;4, then the reference on the page, also very simple, such as:5, in fact, the combination of SharePoint and JavaScript can do a lot of things, recently also use Easyui in SharePoint to do some experimenting, combined with the features of SharePoint itself, feel good.Easyui in the SharePoint a simple exampleAs an example of
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.