I think that this should be possible by creating a time delay function [setTimeout()] that is started on the mouseover event and cancelling the timer delay function [clearTimeout()] on the mouseout event. This way, if the mouse hovers over the link for the duration of the timer delay, then the referenced function will be called. Read more at: http://www.howtocreate.co.uk/tutorials/_javascript_/timers

 

~ David

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: September 13, 2006 12:05 PM
To: [email protected]
Subject: [jQuery] code ideas: if mouseover for 5 seconds then do this elsedo nothi ng

 

Is there any way in jquery to do something like this?

if mouseover for 2 seconds then do this, else do nothing

 

Basically the client I have doesn’t want to use onclick to open a hidden navigation but they also don’t like the mouseover because a user may move over it by accident. What they want is something in between so a user can move over a link to open the nav but have to hold it there for a couple of seconds for it to trigger the function to show the nav.

 

Any ideas would help me a lot thank

 

Daniel

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to