Sometimes it’s nice to allow the user to mouse through an element without triggering the function that’s supposed to be invoked when the user actually mouses onto it and stays there. The simplest way to do that is by waiting a fraction of a second after the event before calling the handler.
hoverDelay does just that, in jQuery plug-in form. It works like jQuery’s hover except that it accepts an extra argument for each function: the number of milliseconds to wait before invoking the handler. Like hover, it works with either one or two handlers.
Download source code with documentation in the comments: hoverDelay.js
Or, you might prefer hoverIntent. I wrote hoverDelay because I didn’t like the Voodoo of involving mouse speed in the decision.
One Response
Incredible, thank you!