質問

Any idea why this isn't working? The children of the unordered list are not sliding up like I expect..

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

役に立ちましたか?

解決

here you go bro this looks like what you want:

http://jsfiddle.net/2x2fE/

他のヒント

I was able to fix this by using mouseover and mouseleave with a selector on the children like so:

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

    $('nav ul li').mouseleave(function(){
        $(this).children('ul').slideUp();
    });
});

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");   
    });
});
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top