Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery hover only to work if hovering for a certain amount of time

Tags:

jquery

hover

In a list of links, I only want to activate the hover behavior for those links after the person is hovering over that link for a certain amount of time (say 1 second). So if they happen to just pass over the link (for less than one second) I don't want the hover event to occur.

Does anyone know how to do this or have any examples of this? Thanks!

like image 604
user373680 Avatar asked Jun 22 '10 22:06

user373680


3 Answers

Yes, There is a plugin for jQuery called hoverIntent that does what you describe.

like image 179
Peter Anselmo Avatar answered Oct 19 '22 20:10

Peter Anselmo


I highly recomend using the hover intent jquery plugin for this. It's solved this problem for me before and seems to be very well written and light.

like image 45
Dr. Frankenstein Avatar answered Oct 19 '22 19:10

Dr. Frankenstein


You can use delay in your hover chain:

http://api.jquery.com/delay/

There is also a plugin called "hoverIntent" which I would link you to if I was allowed.

like image 44
Spencer Avatar answered Oct 19 '22 20:10

Spencer