Hi I have created a jquery megamenu for an ecommerce platform. I have set it up so that when you hover over a li in the top level, all of its siblings ul vanish and the relevant one appears. The problem is if you hover over 'gloves' then 'helmets' very quickly the 'gloves' appears as if there is a delay. Yet, if you go from 'helmets' to 'gloves' very quickly it works fine. any ideas? thanks
here is the jquery code and link to site http://www.firecrestmoto.co.uk/index.php
// Add controller class to <li> on top level
$('#menu.accordion ul li ul li').parent().parent().parent().addClass('parentitem');
// Hide and show entire category and sub categories at the same time
$('#menu.accordion a').addClass('menu_closed');
$('#menu.accordion a').hover(
function(){
$(this).addClass('menu_open');
$(this).siblings('ul').fadeIn();
$('#menu.accordion ul li ul').show();
}
);
$('ul.parentitem').mouseleave(function(){
$(this).hide();
});
// Hover on <li> in the top level menu
$('#menu.accordion li').hover(function(){
$(this).siblings('li').children('ul.parentitem').hide();
$(this).children('ul.parentitem').css('z-index','10000');
});
// Leave the main menu div, all submenus disappear
$('#menu').mouseleave(function(){
$(this).children('li').children('ul').hide();
});
// Add controller classes to <li> on each sub level
$('#menu.accordion').children('li').addClass('topline');
$('#menu.accordion ul.parentitem').children('li').addClass('finallines');