I am trying to add simple animation to css menu http://jsfiddle.net/BGV2Z/2/
The issue seems to be display:block; . If you hover first time menu works fine , on mouseleave the menu that disappeared appears again in far left position or in top position( depending on level ) .
$("li").on('mouseenter', function () {
$(this).find('ul').first().css('display', 'none').fadeIn(500, function () {
$(this).css('display', 'block');
});
}).on('mouseleave', function () {
$(this).find('ul').first().fadeOut(500, function () {
$(this).css('display', 'none');
});
});
I am missing something obvious any help is appreciated. Thank you!