[jQuery] hoverIntent = my first plug-in
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=988110613-13032007><FONT face=Arial
color=#0000ff size=2>That's a nice idea actually. Seems to work quite well in
IE7.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com] <B>On Behalf Of </B>Brian
Cherne<BR><B>Sent:</B> Tuesday, March 13, 2007 3:53 AM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> [jQuery] hoverIntent = my first
plug-in<BR></FONT><BR></DIV>
<DIV></DIV>WHAT?<BR>hoverIntent is a function that attempts to determine the
user's intent... like a crystal ball, only with mouse movement! It works like
(and was derived from) jQuery's built-in hover. However, instead of immediately
calling the onMouseOver function, it waits until the user's mouse slows down
enough before calling the function. <BR><BR>WHERE?<BR>My sorely out-dated web
site.<BR><<A onclick="return top.js.OpenExtLink(window,event,this)"
href="http://cherne.net/brian/resources/jquery.hoverIntent.html"
target=_blank>http://cherne.net/brian/resources/jquery.hoverIntent.html
</A>><BR><BR>WHY?<BR>To delay or prevent the accidental firing of animations
or ajax calls. Simple timers work for small areas, but if your target area is
large it may execute regardless of intent. Also, because jQuery animations
cannot be stopped once they've started it's best not to start them prematurely.
... and I wanted something that was easy to swap in/out with hover (so
hoverIntent returns the same "this" and event objects as hover).<BR><BR>WHAT'S
NEXT?<BR>Your feedback! Tear it shreds! Tell me what you think. I would like to
keep the script as small as possible, but if I could make this more useful (and
more likely to be used) I'm happy to make some enhancements... like... <BR>-
more compelling/verbose demo/documentation<BR>- ability to override default
settings (sensitivity, polling interval, etc)<BR>- option of a simple onMouseOut
timer<BR>- make it more jQuery $-friendly (first few attempts have failed) <BR>-
suggestions for code style/commenting/optimization<BR><BR><BR>Thanks in
advance,<BR>Brian.<BR></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/