views:

35

answers:

1

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 opened, 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

+1  A: 

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.

Ergec
I did not change the .css or .js files but I am using my own ul-li layout which is slightly different then the example. so when I init it I call $('#navigation ul').superfish() instead of $('ul.sf-menu').superfish(). Everything else seems to work except no drop-shadow which I don't care about, but the open drop-downs arent closing immediately when a new one opens, which is annoying. I am wondering if there is a attribute or something I need to add to my list structure to get it to work?
John Isaacks
@John: Do you have an online demo so I can compare?
Ergec
@Ergec I added a link to the demo
John Isaacks
@John: Since you created different menus for each main category, rolling over to Jewelry after Designers is not hiding Designers category because these two are completely different ULs. These main sections have to be List Items of one main Unordered List. You may modify the superfish code to handle this but it would be much easier to modify your menu to work with only one main UL, like the original structure of superfish.
Ergec
Awesome, thank you very much!
John Isaacks