jQuery mouseleave () method
Examples
When the mouse pointer leaves the <p> element, set the background color to gray:
$("p").css("background-color","gray");
});
try it"
Definition and Usage
When the mouse pointer leaves the selected element, mouseleave event occurs.
mouseleave () method triggers mouseleave event or add a function to run when the event occurs mouseleave.
Note: Unlike mouseout event different, mouseleave event only when the mouse pointer leaves the selected element is triggered, mouseout event the mouse pointer leaves any child elements will also be triggered when.See the bottom of the page presentation instance.
Note: This event is usually associated with mouseenter use incident.
grammar
Trigger the selected element mouseleave events:
Adding Functions to mouseleave event:
参数 | 描述 |
---|---|
function | 可选。规定 mouseleave 事件触发时运行的函数。 |
More examples
Different mouseleave () and mouseout () between
Different Demo mouseleave () and mouseout () between.