Latest web development tutorials

jQuery mouseout () method

jQuery Event Methods jQuery Event Methods

Examples

When the mouse pointer leaves the <p> element, set the background color to gray:

$("p").mouseout(function(){
$("p").css("background-color","gray");
});

try it"

Definition and Usage

When the mouse pointer leaves the selected element, mouseout event occurs.

mouseout () method triggers the mouseout event, or add the function to run when the event occurs mouseout.

Note: Unlike mouseleave different events, mouseout event when the mouse pointer leaves the selected element or any child elements will be triggered, mouseleave event only when the mouse pointer leaves the selected element is triggered.See the bottom of the page presentation instance.

Note: This event is usually associated with mouseover use incident.


grammar

Trigger the selected element mouseout events:

$(selector).mouseout() 尝试一下

Add the function to the mouseout event:

$(selector).mouseout(function) 尝试一下

参数 描述
function 可选。规定 mouseout 事件触发时运行的函数。


Examples

More examples

Different mouseout () and mouseleave () between
Different Demo mouseout () and mouseleave () between.


jQuery Event Methods jQuery Event Methods