Home > Article > Web Front-end > jQuery: Use and definition of mouseout event
Overview
Bind a processing function to the mouseout event of each matching element.
The mouseout event will be triggered after the mouse leaves the element
Parameters
fnFunctionV1.0
Bind in the mouseout event of each matching element processing function.
[data],fnString,FunctionV1.4.3
data:mouseout([Data], fn) Data can be passed in for function fn to process.
fn: The handler function bound in the mouseout event of each matching element.
Example
Description:
Change the background color of an element when the mouse moves away from it:
jQuery Code :
$("p").mouseout(function(){ $("p").css("background-color","#E9E9E4"); });
Example
Change the background color of the element when the mouse moves away from it:
$("p").mouseout(function(){ $("p").css("background-color","#E9E9E4"); });
Definition and usage
When the mouse pointer moves from When the element is moved away, the mouseout event occurs.
This event is most often used together with the mouseover event.
The mouseout() method triggers a mouseout event, or specifies a function to run when a mouseout event occurs.
Note: Unlike the mouseleave event, the mouseout event will be triggered whether the mouse pointer leaves the selected element or any child element. The mouseleave event is only triggered when the mouse pointer leaves the selected element. See the example below for a demonstration.
Trigger the mouseout event
Syntax
$(selector).mouseout()
Bind the function to the mouseout event
Syntax
$(selector).mouseout(function)
Parameters Description
function Optional. Specifies a function to run when a mouseout event occurs.
The above is the detailed content of jQuery: Use and definition of mouseout event. For more information, please follow other related articles on the PHP Chinese website!