Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if the cursor is hovering on an element using JQuery

Tags:

It possible to check if the cursor is hovering on an element.

Something like

 $("#divId").is("hover");

NOTE: I just want to check not set event.

like image 768
Mark K Avatar asked Nov 11 '10 00:11

Mark K


People also ask

Is hover () a jQuery event method?

The hover() is an inbuilt method in jQuery which is used to specify two functions to start when mouse pointer move over the selected element. Syntax: $(selector).

What is jQuery mouseover?

jQuery mouseover() MethodThe mouseover event occurs when the mouse pointer is over the selected element. The mouseover() method triggers the mouseover event, or attaches a function to run when a mouseover event occurs.

Is hover deprecated in jQuery?

hover() is deprecated #66.


1 Answers

.is(':hover');

or

$('#divId:hover');
like image 126
Anthony Corbelli Avatar answered Oct 27 '22 06:10

Anthony Corbelli