• Hello,

    I used the tutorial https://www.elegantthemes.com/blog/divi-resources/how-to-create-a-mobile-collapsing-nested-menu-with-divis-theme-builder to customize the mobile menu.

    Unfortunately, the code seems to be changed by autoptimize, so I can’t expand the menu by clicking on the +. But with the parameter ?ao_noptirocket=1 in the URL and on my staging (without caching) it works.

    How can I prevent autooptimize from adapting the code?

    <style>
    .et_mobile_menu .first-level > a {
    background-color: transparent;
    position: relative;
    }
    .et_mobile_menu .first-level > a:after {
    font-family: 'ETmodules';
    content: '\4c';
    font-weight: normal;
    position: absolute;
    font-size: 16px;
    top: 13px;
    right: 10px;
    }
    .et_mobile_menu .first-level > .icon-switch:after{
    content: '\4d';
    }
    .second-level {
    display: none;
    }
    .reveal-items {
    display: block;
    }
    </style>
    <script>
    (function($) {

    function setup_collapsible_submenus() {

    var FirstLevel = $('.et_mobile_menu .first-level > a');

    FirstLevel.off('click').click(function() {
    $(this).attr('href', '#');
    $(this).parent().children().children().toggleClass('reveal-items');
    $(this).toggleClass('icon-switch');
    });


    }

    $(window).load(function() {
    setTimeout(function() {
    setup_collapsible_submenus();
    }, 700);
    });

    })(jQuery);
    </script>

    Thanks a lot, Nico

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    First and foremost try to identify what is breaking the menu by just disabling CSS or JS or HTML or Image optimization (incl. lazyload). Based on that we can see what the next steps need to be ??

    frank

    Thread Starter marketingsog

    (@marketingsog)

    Hi Frank,

    Thanks, when I disable JS it works properly. How can I exclude this script from optimization? Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Can you try changing JS optimization settings, disabling “aggregate JS” and instead use “don’t aggregate but defer” and “also defer inline JS”?

    Thread Starter marketingsog

    (@marketingsog)

    It only works with JS optimization enable and the other disabled. But now the pagespeed is worse

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    If I’m not mistaking you’ve re-enabled “aggregate JS”? I just tested in Chrome & FF on Android and in both cases the dropdown menu works?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.