In this paper, the differences between hover and mouseover and mouseout in jquery are analyzed. Share to everyone for your reference, specific as follows:
Previously thought in jquery actually mouseover and mouseout two events equals hover events. Two is no different, it should be the same. But yesterday an animation effect to let me see, these two are not equal.
<div class= "wrapper" >
<div class= "img" ></div>
<div class= "text" ></div>
</div>
<div class= "point" ></div>
Add an event to the wrapper and enlarge the class= "point" when the mouse moves over the wrapper. However, if you use MouseOver and Mouseout events, when the mouse moved to the wrapper layer, point layer will become larger, but when the mouse in the IMG and the text between the move between the level will become large and small, constant changes. This is not the result we want, we want as long as the mouse on the wrapper layer, whether it is IMG or text, point on the larger, but in the mouse has not moved out of the wrapper layer, the point layer does not become smaller.
Slowly train of thought also clear, we do not need mouseover and mouseout and use hover problem to solve.
It is an exaggeration to say that it took us a long time to solve such a simple problem. Write an article as a souvenir.
Add: Later my master said that in fact there is a paragraph in the jquery source code:
Hover:function (Fnover, fnout) {return
this.mouseenter (fnover). MouseLeave (Fnout | | fnover);
}
That means hover!. =mouseover+mouseout. But Hover=mouseenter+mouseleave.
I hope this article will help you with the jquery program design.