This paper analyzes the difference between hover and mouseover and mouseout in jquery. Share to everyone for your reference, as follows:
It was thought in jquery that in fact mouseover and mouseout two events equals hover events. Two is no different, it should be the same. But yesterday an animated effect just let me see, these two do not equate.
<div class= "wrapper" ><div class= "img" ></div><div class= "text" ></div></div> <div class= "Point" ></div>
Add an event to the wrapper and let the class= "point" layer enlarge when the mouse moves to the wrapper. However, if the mouseover and Mouseout events are used, the point layer will become larger when the mouse moves to the wrapper layer, but when the mouse moves between the IMG and the text layer, it will become larger and smaller, constantly changing. This is not the result we want, we want to be as long as the mouse on the wrapper layer, either IMG or text, point becomes larger, but the mouse does not move out of the wrapper layer, the point layer is not small.
Slowly thinking also clear, we do not have to mouseover and mouseout and use hover problem solved.
It is an exaggeration to think that it took us a long time to solve such a simple problem. Write a story for remembrance.
Add: Later find documents found in the jquery source code has this paragraph:
Hover:function (Fnover, fnout) {return This.mouseenter (fnover). MouseLeave (Fnout | | fnover);}
Which means hover!. =mouseover+mouseout. But Hover=mouseenter+mouseleave.
Analysis of the difference between hover and mouseover and mouseout in jquery