So basically I am trying to create a horizontal ul for my site nav. I want a div to appear below each link with a bounce when you hover over it. The animation is working correctly on hover however on mouseout the div doesn't always go away. I am new to jQuery so I'm not sure what I'm doing wrong. Any help very much appreciated!
//append a div with class blue-hover to all li elements in main-nav
$('#main-nav li a').append('<div class="blue-hover"><\/div>');
$('#main-nav li a').hover(
//Mouseover, show the hidden blue-hover class with a bounce on hover
function() {
$(this).children('div').stop(true, true).show().effect( "bounce",
{times:1}, 300 );
},
//Mouseout, fadeOut the hover class
function() {
$(this).children('div').stop(true, true).fadeTo(0,300);
});