Show submenu's submenu on submenu hover only

后端 未结 3 450
臣服心动
臣服心动 2020-12-11 11:27

I am trying to show the submenu on hovering the menus. I have succeeded in submenu level 1. But when I go to submenu level 2(ie, submenu of submenu) it is not working. I wan

3条回答
  •  醉梦人生
    2020-12-11 11:42

    Use mouseenter and mouseleave events if you want them to be triggered when you hover on the sub-elements.

    $('.nav ul').hide();
    
    $('.nav li').mouseenter(function() {
        $(this).children('ul').stop().slideDown('slow')
    }).mouseleave(function() {
        $(this).children('ul').stop().slideUp('slow')
    });
    

提交回复
热议问题