Here is Zi JsFiddle. In order to replicate my issue you have to hover over the link that says 'javascript', then mouseout that, then mouseback in. If you do this before the animation is complete, the pink slidedown #subMenu will freeze midway through sliding. Is there a way to prevent this from happening? I have tried some .stop()s , but i really don't want the animation to re-start every time you mouseenter or leave the .navLink . The animation should begin from where it left off. In other words, if the pink section is halfway down, and a slideDown() gets executed, the pink should not dissappear and then slide down, it should slide down from where it is.
Thanks!!
JS:
$('header#subHeader').hide();
$('.navLink').hover(function () {
if ($(this).children('div').length > 0) {
var subMenu = $(this).find('.subMenu').html();
$('header#subHeader').empty().append('<div>' + subMenu + '</div>').stop().slideDown();
} else {
$('header#subHeader').stop().slideUp();
}
});
$('hgroup:first').on('mouseleave', function(){
$('header#subHeader').slideUp();
});