js is a relatively simple language, but the essence of js is js events, which is also the most important part of js. Many people don’t know much about what JavaScript mouse events are. Let’s explain JavaScript mouse events in detail below.
1: In js, there are many mouse events, including the following events:
1.ondbclick double-click
2.onmouseover move in
3.onmouseout move out
4.onmousemove move
5.onmousedown press
6.onmouseup loose Open
Under normal circumstances, the principle of the processor is to add on in front of the event, but for the click event, the processor name is onclick. These events are relatively easy to remember. We are very fond of double-clicks. Use less, the main ones are the following mouse events.
2: Detailed explanation of the main events:
1. The most commonly used one is onclick. Many students have also been exposed to it before learning. For example, when we click on a button When , a dialog window will pop up, and buttons can be added to any element.
2. In js, we use onmouseover and onmouseout to represent the movement and removal of the mouse respectively. In fact, these two times are relatively friendly and generally will not be separated. They can all be used together to control the mouse to achieve the two states of moving in and removing. In menu navigation, when the mouse is placed on the first-level navigation, a drop-down navigation will appear, and when the mouse is removed, the second-level navigation will be automatically closed.
In 3.js, we use onmousedown and onmouseup to represent pressing and releasing. onmousedown represents the event that occurs when the mouse is pressed, and onmouseup represents the event that occurs when the mouse is released. However, in actual development, this Two events we rarely use.
The above is about what are JavaScript mouse events? A complete introduction to the detailed explanation of JavaScript mouse events. If you want to know more about JavaScript Tutorial, please pay attention to the PHP Chinese website.
The above is the detailed content of What are JavaScript mouse events? JavaScript mouse events explained in detail. For more information, please follow other related articles on the PHP Chinese website!