0

知道为什么这不起作用吗?无序列表的孩子并没有像我预期的那样向上滑动..

http://jsfiddle.net/SparrwHawk/vqUgw/3/

4

3 回答 3

1

There is some error in you code.

Check the fixed one.

$(document).ready (function(){
    $('nav ul li').hover(function(){
        $(this).children("ul").slideDown().
        addClass('shown');
    }, function(){
        $('.shown').slideUp().removeClass(".shown");   
    });
});
于 2011-09-30T18:29:28.657 回答
1

给你,兄弟,这看起来像你想要的:

http://jsfiddle.net/2x2fE/

于 2011-09-30T18:24:02.207 回答
1

我可以通过使用mouseovermouseleave使用类似的选择器来解决这个问题children

$(document).ready (function(){
    $('nav ul li').mouseover(function(){
        $(this).children('ul').slideDown()
    });

    $('nav ul li').mouseleave(function(){
        $(this).children('ul').slideUp();
    });
});
于 2011-09-30T18:24:45.547 回答