I\'m currently trying to do a menu with submenu. Here is what i want to do.
On hover a link (#mylink) i want to display a div (lets call it \"#submenu\") right under
If you put #submenu inside of #mylink you won't need a second event handler for #submenu and you would have something like this:
var timer;
$(document).ready(function()
{
$('#mylink').hover(function()
{
clearTimeout(timer);
$('#submenu').show();
},function()
{
timer = setTimeout(function(){$('#submenu').hide();},5000);
});
}
By the way, you don't need jQuery for this. In plain js won't be so long to code.