Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there any way to make the accordion menu fully expanded by default?
Thanks
Comments
Comment #1
marcoka CreditAttribution: marcoka commenteddoes not really make sense but i think you can override the css to achive this goal.
Comment #2
deggertsen CreditAttribution: deggertsen commentedIt appears to be something that would need to happen in the javascript, I just can't find where.
My use case is to make a menu that shows by default, but can be hidden by the user if desired. So it has nothing to do with mobile as you would normally use the accordion menu for. Something similar to what the have on the left hand side of http://nike.com
Comment #3
marcoka CreditAttribution: marcoka commentedwell a quick idea may be to emulate a click on the button on load.
Comment #4
deggertsen CreditAttribution: deggertsen commentedThat sounds like a good idea. But how do you do that?
Comment #5
Volker23 CreditAttribution: Volker23 commentedI'd like this feature as well. The accordion is really great and if it would stay open all the time on desktop size it would be a killer. I'm developing a responsive site where an accordion-menu is requested for the big screens anyways. So it would be a nice feature to disable the toggle and the addClass('sf-expanded'), removeClass('sf-hidden')-stuff just for screensize bigger than the breakpoint.
Is this possible? Thanks!
Comment #6
geek.geek CreditAttribution: geek.geek commentedHi,
Easy to achieve with plain CSS! just select the "Enable jQuery sf-Smallscreen plugin for this menu." and use this:
Comment #7
deggertsen CreditAttribution: deggertsen commented@geek.geek That was a great start for me. Thanks! I'll post what I had to put as yours didn't quite do it for me (when I first tried what you put it simply hid the menu so that it was no longer accessible at all...).
Comment #8
Tsjippy CreditAttribution: Tsjippy commentedIn which css file did you put it?
I just created a new style.css file with only this text:
#block-superfish-1 .sf-accordion-toggle {
display: none;
}
#superfish-1-accordion {
left:auto !important;
top:auto !important;
display: block;
position: relative;
}
And I placed it in /public_html/sites/all/libraries/superfish/style.
Then I enabled the style, but that did not work.
Comment #9
Tsjippy CreditAttribution: Tsjippy commentedNever mind, when using block2, it has to be superfish-2-accordion...
Comment #10
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commented