- This topic has 14 replies, 4 voices, and was last updated 3 years, 10 months ago by
David.
-
AuthorPosts
-
June 12, 2022 at 6:06 am #2250872
ammgbr
Hello,
For mobile I have switched off the off-canvas and set mobile break to zero so that the menu items are below the logo.
Is there a way to have the menu all in one horizontal line and be able to scroll horizontally?
June 12, 2022 at 8:26 am #2251108David
StaffCustomer SupportHi there,
If the menu didn’t have sub menus then it would be possible with some CSS.
But the method relies on the container using overflow hidden, which would mean the sub menus would not be visible.
In addition to this there is the tap target to open the sub menus on mobile, which may conflict with the touch scroll.So short answer – we don’t have a solution for that, it would require custom development.
June 12, 2022 at 9:00 am #2251142ammgbr
I see what you mean.
I am keen to simplify my menu and only have categories but no submenus.
May I try the css code and see how ot works?
June 12, 2022 at 12:26 pm #2251274Ying
StaffCustomer SupportTry this CSS:
.main-navigation .main-nav>ul>li { flex-shrink: 0; } .main-navigation .main-nav>ul { flex-wrap: nowrap; overflow-x: scroll; }June 12, 2022 at 2:45 pm #2251361ammgbr
Hello, Ying tried this and it worked!
Is it possible to style it so that each category is separated from the next one with a vertical line (os they appear boxed in) so as they are separated. Each menu category consists of 3 words and I fear they fuse together in a big line. Lastly, how can I change the left / right padding for the scrollable menu?
June 12, 2022 at 8:13 pm #2251475Fernando Customer Support
Hello there,
You can try adjusting Ying’s CSS code to something like this:
.main-navigation .main-nav>ul>li { flex-shrink: 0; } .main-nav > ul.menu > li:not(:last-of-type) > a:after { content: "|"; padding-left: 20px; } .main-navigation .main-nav>ul { flex-wrap: nowrap; } .main-navigation .main-nav>ul>li:nth-of-type(1) { padding-left: 40px; } .main-navigation .main-nav>ul>li:last-of-type { padding-right: 40px; } div#primary-menu { overflow-x: scroll; }I set the padding-left of the divider to
20pxso that it looks aligned in relevance to the current menu item width you have.You can also modify
40pxto alter the padding of the scrollable menu.Kindly let us know how it goes.
June 13, 2022 at 12:09 am #2251589ammgbr
Many thanks works really well
I adjusted the padding left to 10px but the vertical divided is not aligned in the midpoint
June 13, 2022 at 12:11 am #2251591ammgbr
Actually it looks really good will leave it as it is. Many thanks 🙂
June 13, 2022 at 12:23 am #2251606Fernando Customer Support
Glad that worked! You’re welcome! 🙂
June 13, 2022 at 12:29 am #2251609ammgbr
Apologies for the follow up, I just notice that when I select the last option on mobile on the new page the menu height increases ad the options appear over 2 lines?
EDIT
I managed to correct it I think by removing the vertical divider – it now works fine and looks well so I will leave it as it is:)
June 13, 2022 at 1:46 am #2251675Fernando Customer Support
I see. Glad you got it to work!
June 13, 2022 at 2:26 am #2251709ammgbr
I do apologize for the follow up question.
I see on mobile there is a scroll bar , that looks great.
Is it possible not to have the scroll bar on desktop as it looks too prominent?
June 13, 2022 at 3:19 am #2251766David
StaffCustomer SupportTry adding this CSS:
@media(pointer: fine) { #primary-menu::-webkit-scrollbar { height: 0; } }June 13, 2022 at 4:28 am #2251821ammgbr
Many thanks David that works!
June 13, 2022 at 5:46 am #2251880David
StaffCustomer SupportAwesome – glad to hear that
-
AuthorPosts
- You must be logged in to reply to this topic.