How to use mouseout() Method Event in JQuery

This article describe about mouseout() Method Event in jQuery.
  • 2084

The mouseout() Method Event in jQuery

When the mouse pointer remove from the selected element then mouseout event occurs.

And this is work with the mouseover event togather.

The mouseout() method triggers the mouseout event, it is also define what will happens when mouseout event occurs.

Example

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $("p").mouseover(function () {

            $("p").css("background-color", "red");

        });

        $("p").mouseout(function () {

            $("p").css("background-color", "gray");

        });

    });

</script>

</head>

<body>

<p style="background-color:gray">Hover the mouse pointer over this paragraph.</p>

</body>

</html>

 

Output

mouseout method pic52.jpg

Trigger the mouseout Event

Generate trigger of mouseout event for selected element.

Syntax

$(selector).mouseout()

 

Bind a Function to the mouseout Event

It is define a function to run when mouseout event trigger for selected element.

Syntax

 

$(selector).mouseout(function)

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.