B1. mouseover/mouseout和mouseenter/mouseleave和hover

hover: First of all, by viewing the Jquery source code, you can get that hover is the package of mouseenter/.

Target object A has child element B.

Mouseover and mouseenter, the difference:

mouseover/mouseout : When the mouse enters the object A , the corresponding event mouseover will be triggered. When the mouse slides in A and enters B , it is judged to have left A and will trigger the mouseout of object A. When it leaves B, continue to trigger object A Mouseover.

 So sometimes you find that the event flickers , it may be for this reason.

mouseenter/mouseleave : When the mouse enters the object A , the corresponding event mouseenter is triggered, and the mouseleave is triggered when the mouse exits the object A.

 There is no flickering bug of mouseover/mouseout.



Guess you like

Origin blog.csdn.net/u010682774/article/details/79196584