Home > front end >  IE, the mouse move into continuous trigger mouseenter and mouseleave element
IE, the mouse move into continuous trigger mouseenter and mouseleave element

Time:12-09

To achieve a panel, when the mouse moved to show that when the mouse left hidden, to avoid bubbling, using the JQ mouseenter and mouseleave, no problem in other browsers, but in IE, when the mouse moved to trigger mouseenter, then trigger mouseleave, cause panel shows don't come out, the mouse moving elements is arguably not may trigger a mouseleave? So breaking point, finds jq for the time of the event attributes clientX and clientY to 1, my mouse is in the central screen, how can become negative? OffsetX became - 886, just move the mouse elements, how the distance element position so far? Please what a great god,


CodePudding user response:

Offset client try instead

CodePudding user response:

Has been solved, although I don't know why when the mouse just moving elements in Internet explorer will trigger mouseleave, but at this time are the coordinates of the mouse relative to the client area of outside, so there will be a clientX=1; Also met a problem is the transparent background in IE will trigger the mouseleave and later added a 1 * 1 transparent images won't trigger,

CodePudding user response:

Compatible with ie code