Home > Article > Backend Development > In-depth functional analysis of PHP wishing wall module_PHP tutorial
Wish Wall Module Function Analysis
1. Hotspot Technology
1. Implement drag-and-drop DOM technology to move wishing notes
The purpose of the Draggable DOM pattern is to allow the viewer to define the position of each element on the page, and just use the mouse to select the part to be moved and drag it to the new position. Pages can be customized.
DOM is the abbreviation of Document Object Model. It is an interface that is independent of browser, platform and language, allowing users to access other standard components of the page. DOM is a collection of nodes or pieces of information organized in a hierarchical structure. This hierarchy allows developers to navigate the tree looking for specific information. Analyzing this structure typically requires loading the entire document's construction hierarchy before doing any work. Since it is based on information hierarchy, DOM is said to be tree-based or object-based.
In specific implementation, the following times will be triggered:
(1)moveStart
(2)Move
(3)moveEnd
When pressed When you press the left mouse button and start moving the mouse, the moveStart event will be triggered on the dragged wish bar. Users can use the moveStart event handler to enable javaScript code when dragging begins. When the moveStart event is triggered, the Move time will always be triggered as long as the object is still being dragged. When dragging stops, the moveEnd event is triggered.
echo outputs the wish bar style layout, the code is as follows: