开发者

Superfish, 2 menus open at once - how to prevent?

开发者 https://www.devze.com 2022-12-22 04:18 出处:网络
I have a super fish menu, the delay is set to 800, but when I move from one drop-down to another it still shows the previous drop-down and the new drop-down at the same time. until the 800ms delay is

I have a super fish menu, the delay is set to 800, but when I move from one drop-down to another it still shows the previous drop-down and the new drop-down at the same time. until the 800ms delay is over then the previous drop-down goes away. I do not want to change the delay, but if a new drop-down is ope开发者_运维问答ned, I want the previously opened drop-down to close right away without delay. I hope this makes sense.

Is there a way to do that?

Thanks!!

Click to view


On its website, delay is set to 800 and I guess it works fine, it doesn't display old popup. Did you make any other changes in its code?

http://users.tpg.com.au/j_birch/plugins/superfish/#examples

Edit: Ok here is a solution if you don't want to modify your multiple UL menu structure to a single UL. Just give unique ids to each UL, then modify over = function() in superfish.js like this

over = function(){
    var $$ = $(this), menu = getMenu($$);
    $('.sf-menu').each(function(){
        if ($(this).attr('id') != $(menu).attr('id')) {
            $(this).hideSuperfishUl();
        }                       
    });
    clearTimeout(menu.sfTimer);
    $$.showSuperfishUl().siblings().hideSuperfishUl();
},

this may cause some other side effects but I don't see any for now.

0

精彩评论

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