-
jasonhlv
I am using the SafeWheels Theme and the Sub-Menu Being Cut Off.
1. I do not want to use off-canvas menu for desktop view.
2. I want to allow the user to scroll the SUB MENU, not the Menu.
3. I saw some CSS that was posted a year or two earlier:
.main-navigation.is_stuck .main-nav>ul {
max-height: calc(100vh – 60px);
overflow-y: auto;
}Unfortunately, this code makes the ENTIRE menu scrollable which looks terrible.
What CSS do I need to add to make only the SUB MENU scrollable?
Thank you for your help.
-
1. I do not want to use off-canvas menu for desktop view.
The SafeWheels template doesn’t use off canvas menu for desktop.
If you accidentally turned it on, you can turn it off at customizer > layout > off canvas panel.2. I want to allow the user to scroll the SUB MENU, not the Menu.
Not sure what you mean, can I see your site?
3. I saw some CSS that was posted a year or two earlier:
This CSS is not from the template.
What CSS do I need to add to make only the SUB MENU scrollable?
Can i see your site?
-
jasonhlv
I cannot show you the website, it’s not viewable to the public.
A good example is the sub-menu in the SafeWheels template in the GeneratePress Site Library.
Hover over “Insurance” in the main menu.
You will see a drop-down sub-menu showing “Car”, “Motorcycle”, and “Van”.
That’s similar to what you see on my website.
My sub menu for my website has so many choices that it is longer than the entire webpage when viewed on some smaller screen dimensions such as a laptop.
There is no way to scroll down to see the pages that are cut off. I want people to be able scroll down the sub menu if their display is not big enough.
-
My sub menu for my website has so many choices that it is longer than the entire webpage when viewed on some smaller screen dimensions such as a laptop.
in this case, I would recommend using mega menu plugin to create a mega menu.
Or
you need to give the
ul
amax-height
value so that it can be scrolled. Try this CSS for desktop:.main-navigation:not(.toggled) ul li.sfHover>ul, .main-navigation:not(.toggled) ul li:hover>ul { overflow: scroll; max-height: 300px; }
this CSS for off canvas menu:
#generate-slideout-menu.main-navigation .main-nav ul ul { max-height: 300px; overflow: scroll; }
Feel free to change the
max-height
values. -
jasonhlv
Okay, Thank you. This is what I need.
Also, the scroll bar now provides less room to the text in the sub-menu. How do I increase the width of the scrollable sub-menu a little bit, but only do so for desktop view (mobile view seems fine).
Thank you for your time.
-
Try this CSS:
.main-navigation ul ul { width: 300px; }
-
jasonhlv
Okay, thank you. Everything is working the way I want it to now. I appreciate your help.
-
Glad to hear that 🙂
- You must be logged in to reply to this topic.