-
AuthorPosts
-
November 16, 2021 at 4:30 pm #1329235
Hello,
I use Full width submenu for page navigation by sections. It works great on desktop but on mobile looks bad.
How can I make the submenu horizontally scrollable (like for example table blocks have this option for mobile)?
Regards,
DeanNovember 17, 2021 at 2:13 am #1329292Hey cryptotradingbg-com,
Thank you for the inquiry.
The following css code should make the submenu container scrollable when the content or menu items overflow on mobile view.
#top .av-submenu-container .container { overflow: scroll; }
Please make sure to purge the cache or toggle the file compression after adding the css code.
Best regards,
IsmaelNovember 17, 2021 at 8:27 am #1329316Hi Ismael,
Thanks for your assistance. This made desktop version worse but mobile remaining the same. I purged the page as you suggested. Anything else maybe?
I put the css code into the block -> advanced -> Custom css class, is that the correct place?
November 17, 2021 at 9:29 am #1329323Hi,
Thanks for the update. That is not the correct place, please try it under Enfold->General Styling->Quick CSS instead.
Best regards,
RikardNovember 17, 2021 at 9:43 am #1329326I did change the place of the css. Still no luck :/
November 18, 2021 at 4:07 am #1329406Hi,
Thank you for the update.
Did you toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the css? Please provide the site URL so that we can check the modification further.
Best regards,
IsmaelNovember 18, 2021 at 10:03 am #1329456Hi Ismael,
No I didn’t, Should I do this? I purged the page using Lightspeed Cache plug in.
Here is the link to the page with Full width sub menu which I am trying to make scrolling horizontaly.
November 19, 2021 at 5:35 am #1329600Hi,
Thank you for following up.
Yes, you may need to disable the file compression settings temporarily. You could also set the sub menu to display as an icon or as a button on mobile view and smaller screens. The option can be found in the Advanced > Responsive > Mobile Menu Display settings.
Best regards,
IsmaelNovember 19, 2021 at 4:19 pm #1329707Hi Ismael,
Compression settings are disabled now. Still the same. I would like the sub menu to be sticky – displayed as text links not to have to be clicked on a menu icon to view.
I can see this option applied to many different websites. I would like to figure out a way to do it with Enfold. Is this not possible?Regards,
November 21, 2021 at 2:04 am #1329816Hi,
To not have a menu icon in mobile for your sub-menu please change the Mobile Menu Display option to Display Full Menu
As for having a sticky sub-menu on mobile, I have a solution that works on an Enfold install, but it doesn’t seem to work on your site, perhaps due to your sub-menu has the menu button showing right now, but you can try.
Try adding this code to the end of your functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> (function($){ $(function() { var scroll_start = 0; var startchange = $('#sub_menu1'); var offset = startchange.offset(); if (startchange.length){ $(document).scroll(function() { scroll_start = $(this).scrollTop(); if(scroll_start > offset.top) { document.getElementById('sub_menu1').classList.add('sticky-top'); } else { document.getElementById('sub_menu1').classList.remove('sticky-top'); } }); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
and add code in the General Styling ▸ Quick CSS field or in the WordPress ▸ Customize ▸ Additional CSS field:
.sticky-top { position:fixed!important; top:0!important; z-index:10000!important; }
if this doesn’t work Please include an admin login in the Private Content area so we can investigate.
Best regards,
MikeNovember 24, 2021 at 2:52 pm #1330315Hi Mike,
Thanks for your reply.
I made the changes you suggested. It is now sticky, but not scrolable horizontally as desired.
Does your code include horizontal scrolling?
Regards
November 24, 2021 at 2:53 pm #1330318Actually nothing changed, just that I removed the button view.
November 26, 2021 at 7:38 am #1330547Hi,
Thank you for the update.
The first css code that we suggested above should make the submenu scrollable horizontally. Just wrap it inside a css media query to apply it on mobile view only.
@media only screen and (max-width: 767px) { #top .av-submenu-container .container { overflow: scroll; } }
Can we access the site? Please provide the login details in the private field.
Best regards,
IsmaelNovember 30, 2021 at 1:11 pm #1330989Hi Ismael,
Thanks for your reply.
What do you mean inside a css media query? Where exactly should I insert the additional CSS you provide?December 1, 2021 at 10:36 am #1331104Hi,
We already included the css media query above. You can directly add it in the Quick CSS field or in the child theme’s style.css file.
Thank you for your patience.
Best regards,
IsmaelDecember 1, 2021 at 3:16 pm #1331176This is not working either. I am not confortable sharing login details. I guess just leave it unsolved. My first case unsloved not best for future trust in Enfold support.
December 2, 2021 at 10:17 am #1331267Hi,
This css works properly on our end.
@media only screen and (max-width: 767px) { #top .av-subnav-menu { margin: 0; max-height: 51px; width: 100%; overflow-y: hidden; overflow-x: scroll; display: flex; } }
As you can see in the screenshot below, the first and last menu items are partially scrolled.
Screenshot: https://1drv.ms/u/s!AjjTfXSRbKTvvFtxjc11lcldUzjb
Best regards,
IsmaelDecember 2, 2021 at 10:48 am #1331271Hi Ismael,
Now it is one raw only. Which is good. But submenu links are stuffed rather than scrollable. Attached scr shot.
December 3, 2021 at 6:58 am #1331394Hi,
Thank you for the screenshot.
Did you remove the previous css code before or after adding the latest one? Unfortunately, we will not be able to help you further if we cannot access site. It would be much easier for the both of us if we can inspect the elements and directly modify the code.
Best regards,
IsmaelDecember 7, 2021 at 12:39 pm #1331830December 8, 2021 at 3:39 am #1331909Hi,
Thank you for the info.
Looks like you have modified the fullwidth submenu element quite a bit using the css hero plugin, which overrides the default theme styles. Can we remove the css hero styling for the submenu?
Best regards,
IsmaelDecember 8, 2021 at 8:22 am #1331936This is the first time I use a submenu block I think. It probably takes css hero modification form another block?
Is it safe to just remove the submenu css? Could it be that this will apply to another type of block?
December 8, 2021 at 8:44 am #1331939I now remember I tried to modify this fullwitdh menu during this thread. You can remove that one.
I see some breadcrumbs appeared. I tried to make them show up before but no success.December 9, 2021 at 9:05 am #1332080Hi,
We modified the css a bit to override the styles added by css hero.
@media only screen and (max-width: 767px) { #top .av-subnav-menu { margin: 0; max-height: 51px; overflow-y: hidden; overflow-x: scroll; display: flex; width: 100%; height: 51px !important; line-height: 51px !important; } html>#top>#wrap_all>#main>#sub_menu1>div>#av-custom-submenu-1>li { overflow: visible !important; display: block !important; float: left !important; padding-top: 0 !important; } }
As you can see in the screenshot below, the submenu is now scrollable.
Unfortunately, site optimization is beyond the scope of support but one thing that we would recommend is to completely disable css hero because it adds redundant and unnecessary css codes in the site. If you check the css dashboard, there are now 10,000 css rules, which contains empty declarations and repeated css. For more info about site optimization, please check the following articles.
// https://kriesi.at/archives/scoring-100-100-in-google-pagespeed-insights-gtmetrix-pagespeed-and-yslow
// https://gtmetrix.com/wordpress-optimization-guide.htmlBest regards,
IsmaelDecember 9, 2021 at 2:42 pm #1332144Thanks for all your efforts, there are some stripes now between the linked words. Not great to have them but okay to leave it like this as I already took a lot of your time and it turns out it is all my fault due to css hero.
Yeah, I know. I have low coding skills and css hero helps a lot in such case actually. Think it is still a good trade off.
December 10, 2021 at 11:32 am #1332272Hi,
No problem. For some reason, we do see any stripes between the menu items. You can check the screenshot above to see how it looks on our end.
If you have more questions, please feel free to open another thread. We will close this thread for now.
Have a nice day.
Best regards,
Ismael -
AuthorPosts
- The topic ‘Full width submenu horizontal scroll’ is closed to new replies.