There are many buttons on the interface. Now the prompt box is displayed when the mouse is moved in, and disappears when the mouse is moved out. How to determine which button's move in and remove event is caused.
Can I write directly based on the wheelmenu.js ring menu?
To be honest, I don’t understand what you want to ask. Generally speaking, there are two commonly used methods to determine the target element:
One is to bind an event to each button, so that the elements corresponding to each corresponding event are relative.
The second is achieved through event delegation, and e.target is used to determine which button is triggered.
There is also a situation like in canvas. Since it is impossible to directly obtain whether each object in the canvas triggers an event, you need to use the observer mode to determine whether the mouse position is inside an object. As for detecting whether The ray method can be used inside the polygon.
Event delegation. Judge based on e.terget. Or use observer mode and use unique values as parameters
General plug-ins will have a callback function. If so, you can reconstruct the callback
to delegate the click event to each btn to determine which btn it is
Delegation
Write the event in a container, such as
p
Event delegate evt.target