Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #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,
    Dean

    #1329292

    Hey 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,
    Ismael

    #1329316

    Hi 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?

    #1329323

    Hi,

    Thanks for the update. That is not the correct place, please try it under Enfold->General Styling->Quick CSS instead.

    Best regards,
    Rikard

    #1329326

    I did change the place of the css. Still no luck :/

    #1329406

    Hi,

    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,
    Ismael

    #1329456

    Hi 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.

    #1329600

    Hi,

    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,
    Ismael

    #1329707

    Hi 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,

    #1329816

    Hi,
    To not have a menu icon in mobile for your sub-menu please change the Mobile Menu Display option to Display Full Menu
    2021-11-20_002.jpg
    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,
    Mike

    #1330315

    Hi 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

    #1330318

    Actually nothing changed, just that I removed the button view.

    #1330547

    Hi,

    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,
    Ismael

    #1330989

    Hi Ismael,

    Thanks for your reply.
    What do you mean inside a css media query? Where exactly should I insert the additional CSS you provide?

    #1331104

    Hi,

    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,
    Ismael

    #1331176

    This 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.

    #1331267

    Hi,

    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,
    Ismael

    #1331271

    Hi Ismael,

    Now it is one raw only. Which is good. But submenu links are stuffed rather than scrollable. Attached scr shot.

    #1331394

    Hi,

    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,
    Ismael

    #1331830

    Okay

    #1331909

    Hi,

    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,
    Ismael

    #1331936

    This 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?

    #1331939

    I 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.

    #1332080

    Hi,

    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.html

    Best regards,
    Ismael

    #1332144

    Thanks 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.

    #1332272

    Hi,

    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

Viewing 26 posts - 1 through 26 (of 26 total)
  • The topic ‘Full width submenu horizontal scroll’ is closed to new replies.