Js drag prototype declaration and usage summary, js drag prototype Declaration
The following is a self-written prototype declaration about js Drag and Drop: the code is as follows:
Notes:
1. Point this to who it actually points to-find out the object it refers
2. Use of the call () method
3. What is the difference between assigning a parent prototype to a child level directly and assigning it to a child level using?
For example:
For (var I in Drag. prototype) {LimitDrag. prototype [I] = Drag. prototype [I]; ---------- THE CHILD level is changed and its parent level is not affected} LimitDrag. prototype = Drag. prototype; --------- directly assigning the prototype to the sub-level will cause the parent level to change when the sub-level changes.
The Code is as follows:
<Html>
The above is all the content of this article, hoping to help you learn.
Articles you may be interested in:
- Javascript supports firefox, ie7 page layout, drag-and-drop effect code
- The offsetLeft, offsetTop, offsetWidth, and offsetHeight attributes of Javascript drag-and-drop articles 2
- JQuery Dialog (JS modal window, DIV that can be dragged)
- About js drag-and-drop upload [a drag-and-drop upload process for modifying an avatar]
- Js prototype chain principles
- Div drag plug-in -- JQ. MoveBox. js (self-made JQ plug-in)
- Javascript drag and drop upload class library DropzoneJS usage
- Js perfect div drag-and-drop instance code
- Javascript Implementation of moving a child form by dragging the mouse
- JS object-oriented basic explanation (factory mode, constructor mode, prototype mode, hybrid mode, dynamic prototype mode)