2. If the mouse comes out of p1 or p2 and the mouse does not enter p1 or p2 within 0.5 seconds, the method will be triggered. If entered within 0.5 seconds, the timer will be cleared and the method will not be triggered!
First of all, you should declare the relationship between the two p. It is best to post code or pictures so that others can respond to your questions.
Secondly, what you should ask is the idea of solving this problem, rather than hoping that others will write the solution code and then copy use it.
You need to learn how to clarify your thoughts and solve problems, which will help your growth.
Then use bind multiple events. Why not use the native addEventlistner? It supports everything natively. jq operation is also based on this.
1. Place two p's on the same p and add a mouse out event on p3.
2. If the mouse comes out of p1 or p2 and the mouse does not enter p1 or p2 within 0.5 seconds, the method will be triggered. If entered within 0.5 seconds, the timer will be cleared and the method will not be triggered!
First of all, you should declare the relationship between the two
p
. It is best to post code or pictures so that others can respond to your questions.Secondly, what you should ask is the idea of solving this problem, rather than hoping that others will write the solution code and then
copy
use it.You need to learn how to clarify your thoughts and solve problems, which will help your growth.
The idea is to bind events to the document, and use event delegation to query whether the mouse is on p1 or p2,