Slide on Hover: Queue Build Up

Slide on Hover: Queue Build Up

Hi everyone,

I have a fairly common problem but I didn't find an elegant solution.
I'm trying to slide in a submenu on hover. The problem is the queue build up when moving the mouse over it quickly.
Here's my code:

  1. <script>
  2. $(function(){
  3.       $("nav ul li").hover(function(){
  4.             $(this).find('.subnav').stop(true, true).slideDown('slow');
  5.       }, function(){
  6.             $(this).find('.subnav').stop(true, true).slideUp('slow');
  7.       });
  8. });
  9. </script>
I added the "stop(true, true)" to fix the build up problem but that's not what I want because when I hover while it's sliding up it "jumps" to a height of 0 before expanding. I think that's because of the second "true" parameter (jumpToEnd). Without it .subnav doesn't open all the way anymore (it doesn't have a specific height specified).

Does anyone know a way to do this?

Thanks!
- Thomas