JQuery mouseleave()
JQuery mouseleave()
is a method that allows you to execute a function when the mouse pointer leaves an HTML element.
Syntax
The basic syntax for mouseleave()
method is as follows:
$(selector).mouseleave(function)
Use
mouseleave()
method is useful when you want to trigger an event when the mouse pointer leaves an HTML element, such as hiding a dropdown menu or an overlay image.
Example
Here is an example of using mouseleave()
method to hide an overlay image: