Tutorial on helping customers (www.bkjia.com)Javascript mouse events are a huge family. There are eight common examples:
Mousedown: the mouse button is pressed.
Mouseup: the mouse button is released.
Click: click the mouse button.
Dbclick: the mouse button is pressed.
Contextmenu: Right-click the menu.
Mouseover: move the mouse over the target.
Mouseout: move the mouse over the target.
Mousemove: move the cursor above the target.
The mousedown event and the mouseup event can be said to be the time subdivision of the click event. The order is mousedown => mouseup => click. Therefore, a click event usually triggers several mouse events.
The mousedown event and the mouseup event can be said to be the time subdivision of the click event. The order is mousedown => mouseup => click. Therefore, a click event usually triggers several mouse events.
With them, we can do many things, but it is obviously not enough for high-level applications (such as games, therefore, the Click Event of the mouse event is further subdivided based on whether it is a left-click or right-click event. In DOM2.0, W3C uses the mouse event as an example, and the mouse event is parsed as a MouseEvent (we can use e. constructor = MouseEvent to determine whether it is a mouse event. Whether it is left-click or right-click is determined by a button attribute. The following is the W3C standard example:
0: Left click
1: press the middle key (if any)
2: Right-click
Of course, Microsoft will not compromise, because e. button was originally implemented by Microsoft, and the Web site uses e. which, but it is more complicated than Microsoft.
0: no key is pressed
1: Left click
2: Right-click
3: The left and right buttons are pressed at the same time.
4: press the middle key
5: both the left and middle buttons are pressed.
6: The key and right-click are both pressed
7: The three keys are simultaneously pressed.
- 5 pages in total:
- Previous Page
- 1
- 2
- 3
- 4
- 5
- Next Page