I'm using this code:
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function navBar_open()
{ navBar_canceltimer();
navBar_close();
ddmenuitem = $(this).find('ul').css('visibility', 'visible');}
function navBar_close()
{ if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}
function navBar_timer()
{ closetimer = window.setTimeout(navBar_close, timeout);}
function navBar_canceltimer()
{ if(closetimer)
{ window.clearTimeout(closetimer);
closetimer = null;}}
$(document).ready(function()
{ $('#navBar > li').bind('mouseover', navBar_open) //mouseover
$('#navBar > li').bind('mouseout', navBar_timer)}); //mouseout
document.onclick = navBar_close;
which works fine
what i'd like to do is add a delay to the mouseover event
i'll be honest, I found this code on another site and don't completely understand how it works.
I get that when the user mouses out, the navBar_timer function is called, which adds some kind of delay before the dropdown menu is hidden again, but i don't quite see how to implement a hover on the mouseover.
any guidance would be appreciated
thanks