The Drag status is x: 0, y: 0 Drag me.Any directionHorizontal DirectionVerticalStop draggingEnable dragRestore initial status
Basic drag:
New Dragdrop ({target drag element HTMLElemnt required bridge: Specifies the drag start when the mouse is pressed, whether dragable can be dragged in the modal dialog box (true) default dragX true/false horizontal direction cannot be dragged (true) default dragY true/false vertical direction cannot be dragged (true) default area [minX, maxX, minY, maxY] specifies the drag range. By default, the callback function is used when callback is dragged });
The most technical content of drag and drop is this section:
If (el. setCapture) {// IEE. on (el, "losecapture", mouseup); el. setCapture (); e. cancelBubble = true;} else if (window. captureEvents) {// standard DOMe. stopPropagation (); E. on (window, "blur", mouseup); e. preventDefault ();}
This effect is not implemented using JQuery, pure native JavaScript. For details, refer. The drag effect is smooth, natural, and the CPU performance is not significantly fluctuating.
You can view the source code on this page after dragging it.