title: Preventing jquery mouseleave event from firing while mouse button is held down
body: <p>I have a simple piece of code which shows a scrollbar when the mouse is over a container, and fade it out when the mouse leaves:-</p>
  
  <pre><code>$('#sidebar-wrapper').on('mouseenter mouseleave', '#TopPane, #BottomPane', function(e){
  
  var $div = $(this).find ('.jspDrag');
  
  
      if ( e.type == 'mouseenter') {
      $div.show();
      }
  
      if ( e.type == 'mouseleave' ) { 
      $div.fadeOut('600');
      }
  
  
  });
  </code></pre>
  
  <p>What I want to do is have a mousedown event on $('.jspDrag') that will prevent the mouseleave event from firing for the whole duration that the mouse is held down.</p>
  
  <p>The idea is that if the user is moving the scrollbar with the mouse by holding down the button on it, they may accidentally slip out of the element, if so I do not want the custom scrollbar div to fadeout, as long as the left mouse button is still held down.</p>
  
  <p>I have playd with setTimeout but and the mousedown events but have been able to find a solution that provides the correct behaviour.  Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>Just to provide more detail - I am looking for the same behaviour that the "facebook" sidebar custom scrollers have.  On Facebook the scroller appears when you hover over the sidebar, as does mine.  But on Facebook if you hold the mouse down and move the mouse out of the sidebar or even on to the actual browser scroller, the custom scroller remains visible and active.  This is the bahviour I wish to emulate.</p>
  
  <p>EDIT 2:</p>
  
  <p>I have added a JsFiddle to demonstrate as requested.  I have stripped the css/content as much as possible.  Ig you hover your mose over the top div you will see the hidden custom scrollbar appear.</p>
  
  <p><a href="http://jsfiddle.net/wSMVg/" rel="nofollow">http://jsfiddle.net/wSMVg/</a></p>