Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
137
rated 0 times [  141] [ 4]  / answers: 1 / hits: 18612  / 14 Years ago, fri, april 2, 2010, 12:00:00

Is there a function I can call to know if a certain element is currently being hovered over, like this?



/* Returns true or false */
hoveringOver(a#mylink);

More From » html

 Answers
116

You can use jQuery's hover method to keep track:



$(...).hover(
function() { $.data(this, 'hover', true); },
function() { $.data(this, 'hover', false); }
).data('hover', false);

if ($(something).data('hover'))
//Hovered!

[#97176] Tuesday, March 30, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dylondarrianb

Total Points: 48
Total Questions: 109
Total Answers: 104

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;