Jquery: encasing div and anchor link binded to same event.
- by centr0
im having trouble figuring out how to bind mouseout() to my entire nav bar including the links.
when a user hovers over a link in #nav a sub menu is shown. all is well there.
what i want to do is fadeOut that sub menu when the user hovers out of the entire #nav.
my code for the mouseout:
$('#nav').mouseout(function() {
setTimeout(function() {
//$('.sub-link').fadeOut();
}, 2000);
});
when i hover over an anchor link which resides in #nav, i see the sub-menu. then i guess the mouseout() even fires and the sub-menu fades out. is there anyway to have the #nav and any anchor links within it to act as one?
i'd paste my markup but even indenting it 4 spaces still shows as rendered html..
TIA