hoverDelay jQuery Plug-in

Posted at 12:44 am on September 24th, 2010

Filed in:

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

  1. Incredible, thank you!

    June 28th, 2011 at 11:54 am

Leave a Comment

  • Formatting
    • No HTML. Any code you enter will display as that code.
    • If you are putting code in your reply in order to present the code itself, you can use these special HTML comments for formatting:
      Inline: <!--code-->...<!--/code-->
      Block: <!--pre-->...<!--/pre-->

© Thomas Peri