When the parent element has a mouse move in and out event, you don't want the child element to trigger (for example, when nesting a div, when you move to the inner div border, the mouse move out event will be triggered)

If there are child elements in the element that uses the mouse over event, the child elements will also trigger. For example, when nesting a div, moving to the border of the inner child element will trigger the mouse out event

At this time, use mouseenter and mouseleave instead of mouseover and mouseleave

$('div').on({
   mouseenter : function(){
   
     } ,
    mouseleave : function(){


        } 
    }) ;

 

Guess you like

Origin blog.csdn.net/qq_44782585/article/details/109486300
Recommended