Drupal Version
7.59
Superfish Version
7.x-2.0
Superfish Library Version
1.2 - the one linked to in drupal.org/project/superfish
Included menu
3 levels deep
My desire is to always display two levels. I have a Javascript file to find a taxonomy the page to determine which of the top two buttons needs to be expanded. The script will add sf-hover class to the top menu item that I want expanded. Individual or Business.
Problem
When on a page that is not one of the ones included in the menu, on mouseleave of any of the menu tabs, the second level will disappear.
When on a page that is one of the ones in the menu, mouseleave of any of the menu tabs does not cause the second level to disappear.
When the second level disappears, the "ul" element containing the second lever gets "sf-hidden" class. I do not know where that is happening.
My Javascript added a listener for mouseleave and removes the sf-hidden from the one I want displayed but something after my Javascript execution overrides it and places sf-hidden on the UL tag.
Configuration Settings
Horizontal Double Row
Style - None - I copied one of the example CSS files and modified it
Slide-in effect - none
Menu depth - -1
Path levels - 1
My end question - why does this only happen on pages that are not one of the pages in the menu?
Comments
Comment #2
washburn commentedI found a workaround to solve my problem.
With Javascript, I added "active" class to a button in the last item in the second level links that I did not want to disappear. I do not use "active" for styling so for now this seems to work.
Comment #3
washburn commentedClarification - I needed to add "active" class to the tag, not the tag.
Comment #4
washburn commentedthe above fixes were not solid fixes.
Something in superfish.js was giving sf-hidden class to the UL just below the top level LI.
My final fix involved using CSS to override the sf-hidden class that was added to the UL I wanted displayed.
With Javascript I set up a listener for mouseover on the top level LI items so that when the mouse hovered over the top level LI items, I added a class to the one being hovered and removed that class from other top level LI items. The class is "current-parent".
My CSS fix is:
/* keep second level always visible */
.current-parent>ul {
display: inline !important;
visibility: visible!important;
display: block!important;
left: 0!important;
top: auto!important;
}
This overrides sf-hidden.
Comment #5
ivnish