开发者

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'); } 
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜