View Full Version : jQuery having problems with Jquery animation queue/subnavigation/hover

01-15-2011, 10:57 PM
Ahoy there everybody. I am using a subnav menu script I found. But I modified it just a bit to make the subnav bar animate when a user hovers.

You can see my current work here (http://www.myrtlebeachsitemasters.com/weird-navigation.html).

Looks like it works fine, correct? Well, for example, hover over Golf Packages, then Golf Courses, then back, then back again, then faster, faster faster. VERY FAST. Notice what the subnav is doing.... eventually... it quits showing up!

It SEEMS like to me the slideup (or maybe down) animation is not finishing, causing the original reference point to change before it starts the new?

Here is the code for the functions/animation:

// <![CDATA[
var timeout = 1300;
var closetimer = 0;
var ddmenuitem = 0;

function ddmenu_open(){
ddmenuitem = $(this).find('ul').stop(true,false).slideDown(250);


function ddmenu_close(){
if(ddmenuitem) ddmenuitem.slideUp(100);

function ddmenu_timer(){
closetimer = window.setTimeout(ddmenu_close, timeout);

function ddmenu_canceltimer(){
closetimer = null;

document.onclick = ddmenu_close;
// ]]>

$(document).ready(function() {

$('#ddmenu .mm').bind('mouseover', ddmenu_open)
$('#ddmenu .mm').bind('mouseout', ddmenu_timer)

I have tried different combinations of stop() and even attempted to learn about queue and dequeue (although I must admit, that is a bit over my head.)

Does anyone have any thoughts?