Jquery menu, select just the next child depth
example here http://www.brvr.net/menu
Hello,
finishing my menu, but with one problem.
On mouse over / leave it works good, but on hover the 3rd level (nivel_3) is showed when hovering 1st level (novel_1), with should just show the 2nd level (nivel_2)
how can I s开发者_StackOverflow中文版olve this
$('.nivel_'+nivel+'').hover(
function() { $(this).find('ul > li').css('display', 'block'); },
function() { $(this).find('li').css('display', 'none'); }
);
Thanks
Without knowing your HTML it's hard to be exact, but I expect you only want the ul
that are direct children of the element being hovered.
$('.nivel_'+nivel+'').hover(
function() { $(this).find('> ul > li').css('display', 'block'); },
function() { $(this).find('li').css('display', 'none'); }
);
精彩评论