title: Keeping a sliding menu open on mouseover
body: <p>I'm trying to convert an existing menu system which is loaded with inline Javascript into new, more efficient, code using only jQuery.</p>
  
  <p>I have a horizontal bar with rollover images.  I have a hidden field in the page containing an integer value.  When a page is loaded, the corresponding menu is loaded with a "sticky" version of the image and all other menu items swap images on mouse enter &amp; leave.  It was loaded with tons of inline Javascript and a monster Javascript file that was tedious to convert every time I created a new site.</p>
  
  <p>I successfully converted this all to jQuery where I was also able to disable the click on the sticky menu item.  Now I can simply set some variables and easily customize it per each site's design.</p>
  
  <p>Working great...</p>
  
  <p>Now comes a new issue.  One design contains a bunch of sliding drawers under each menu image.  The sliding animations are handled by an external JS file and the menu drawers themselves are each just a DIV containing the content nested inside a container DIV.</p>
  
  <p>So then I wrote some simple stuff for jQuery that animates the DIV and slides it in and out on mouse hover for the menu images.</p>
  
  <p>The problem is that I cannot seem to solve the problem of the mouse moving away from the menu image and down into the menu drawer without the drawer closing.  I understand the "why?"... I am leaving the image which triggers the animation to close the drawer before I can get inside.  If I apply the hover animations to the drawer container it simply creates a zone under the menu which also triggers the animation, and I don't want that either.  It seems to be turning into a more complex problem with jQuery.  All this was working fine with the inline Javascript... you could just move your mouse from the image into the adjacent open drawer without triggering the function to close it... as if the inline "mouse enter" for the drawer cancelled out the image's "mouse leave".</p>
  
  <p>Any suggestions?</p>
  
  <p>Thank-you!</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I believe I solved this by using .stop(true, false) when passing from the image and into the drawer.  This stops the animation dead before it even starts.  Then the same when entering the image BEFORE initiating the normal animation... this has the effect of stopping the animation triggered by leaving the drawer and entering the image but also does nothing when just entering the image normally.  More testing and then I'll post some sample code.</p>
  
  <hr>
  
  <p>EDIT #2:</p>
  
  <p>I have it working with "stop()" and "delay()" to control the animation but it's possible to freeze the opening of the drawer if you can get your mouse into it faster than it takes to open it.  Installed with 150 ms. but right now set to 300 ms to exaggerate the problem.</p>
  
  <p>Relevant code posted here...</p>
  
  <p>jsfiddle.net/qPLVp/8/</p>
  
  <hr>
  
  <p>EDIT #3:</p>
  
  <p>Thanks to Neil, this is functioning very well now.  With a quicker animation speed, the condition of a mouse overshooting the menu image and entering the drawer will be kept to a minimum.  But if it happens to occur, the drawer will not close which is much better than it closing from under your mouse.</p>
  
  <p><a href="http://jsfiddle.net/elusien/PayFw/8/" rel="nofollow">http://jsfiddle.net/elusien/PayFw/8/</a></p>
  
  <hr>
  
  <p>EDIT #4:</p>
  
  <p>Again thanks to Neil, this is a more efficient version of the same code...</p>
  
  <p><a href="http://jsfiddle.net/PayFw/9/" rel="nofollow">http://jsfiddle.net/PayFw/9/</a></p>