Thanks Jake,
Actually, the code above is only concerning folding up the menu after the click (without it, unless you move the mouse the menu just stays there, even though the content loads behind it).
The reason for the show() is because without that, when you next hover (or even click) on a top level menu item, it does not expand downwards (or any direction!). If I add the show(), you can detect that it's there when the menu slidesUp. I guess it's making the making the menu items visible if they were extended, but since they're not extended, you can't see them even I used show(). I think it's a hack and probably there is a better way to do that!
I'm trying to create a separate function to trigger on hover, to be responsible for slideDown() and slideUp() of the menus as the mouse moves on and off them. There's a couple of ways I can think of to tackle this. Neither of them are yet working. I've included them below.
Method 1
- $(document).ready(function() {
$('#nav ul li').bind('mouseover', function (e) {
e.preventDefault();
$(this).slideDown(1000);
})
return false;
})
Method 2
- $(document).ready(function() {
$('#nav ul li').hover(function(e) {
e.preventDefault();
$(this).stop().slideDown(1000);
});
return false;
});
Neither of them seem to do anything. I'm concentrating first on the slideDown(). I just figured it would be easier to know if I had a result if the slideUp wasn't trying to counteract it. I'm planning to add that after I've got a slideDown functioning.
Thanks again Jake.
Peter
A Linux Admin
Willing to help maintain Linux servers remotely for a tiny consideration into my Paypal account :-)