开发者

Multiple sliding menu - .stop()

I have this problem. I have sliding menu (3 levels) and when I several quick cross over menu with mouse it sliding up and down several times. I know that jQuery function .stop() repair this but I dont know how to use it.

I have this jquery code:

    $(document).ready(function(){ 
    $('menu li').hover(function() {
        $(this).find('ul.menu2').slideDown().end().find('a.prvy').css('backgroundPosition','bottom center');
        var width = $(this).find('ul.menu2').css("width");
        $(this).find('ul.menu2 li ul.menu3').css("left",width);
        $(this).find('ul.menu2>li').hover(function() {
            $(this).find('ul.menu3')).fadeIn().end().find('div.text').addClass('activ');
        }, function() {
            $(this).find('ul.menu3').fadeOut().end().find('div.text').removeClass('activ');
        });

    }, function() {
        $(this).find('ul.menu2').slideUp(300).end().find('a.prvy').css('backgroundPosition','top center');
    });
}); 

I tries somethink likes:

 $('menu li').stop(false,trues).hover(function() {

But it doesnt work.

Thank you for your answers and sorry for my Engl开发者_StackOverflow社区ish.


try without parameters:

$(this).find('ul.menu2').stop().slideDown()

onHover 3 level drop-down menu, is kinda BAD PRACTICE.

  • not practical for mobile users
  • hard to use with touch-pad
  • to complicated to navigate in general

if you must use dropdown menu, consider doing something more subtle,

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜