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:
- <script>
- $(function(){
- $("nav ul li").hover(function(){
- $(this).find('.subnav').stop(true, true).slideDown('slow');
- }, function(){
- $(this).find('.subnav').stop(true, true).slideUp('slow');
- });
- });
- </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