1

I have superfish menu and I want it to behave as expected in all cases except I have some submenu items that I want to always have open. I have given them a class of sf-exclude

<ul class="sf-menu">
  <li><a>Parent Item</a>
    <ul> ... </ul> <-- this behaves as expected
  </li>
  <li><a>Parent Item</a>
    <div class="sf-mega">
      <ul class="sf-exclude"> ... </ul> <-- these menu items remain open always but retain sfHover toggle
      <ul class="sf-exclude"> ... </ul>
    </div>
  </li>
</ul>

In my JavaScript I have something like this:

jQuery(".sf-menu").superfish({
  onHide: function() {
    if (this.attr('class') == 'sf-exclude'){return false;} <-- this is not preventing the hide
  }
});

I have tried onBeforeHide. I have adjusted everything I can in the CSS. No idea what I am doing wrong... any suggestions?

Jon
  • 997
  • 9
  • 16

1 Answers1

0

I found the answer:

jQuery(".sf-menu").superfish({
  onBeforeHide: function() {
    if (this.attr('class') == 'sf-exclude'){
      this.stop(true,true);
    }
  }
});

the biggest key was just stopping the execution of any jQuery animations currently in the stack, but allowing the process to keep going, so that I can keep the sfHover class being added, etc. Using stop(true,true) does this.

Jon
  • 997
  • 9
  • 16