Mobile Submenu not displaying

Attempting to correct my submenu dropdown on mobile. Currently, none of the submenus are working from burger menu.

  • Dimitris
    • Support Star

    Hello there Lee

    I noticed a JS error in your staging site:

    and after inspecting the codebase of the theme in use, it seems that in mobile views there are some additional dropdown “hamburgers” in submenus that are getting added via JS code as well.
    So as the above script is halting, it doesn’t run any other JS code that’s after that.

    Based on the error message, and keep in mind that I couldn’t replicate in a testing site of mine, you need to set a Google Map API key in Appearance -> Theme Options -> General Settings -> general Settings -> Map Api Key.
    Can you please proceed with that and check if that makes any difference?
    You should be getting buttons like this:

    We could also copy the corresponding JS snippet from the theme and run it manually via a plugin or a custom MU plugin, but I believe that above error may also affect other aspects of the theme, so it’s better to get resolved. :slight_smile:
    For future reference, here’s the code that should bring back these buttons:

    (function ($) {
      $(document).ready(function () {
        if ($('.site-header .navbar-nav .sub-menu').length) {
          $('.site-header .navbar-nav .sub-menu').parent('li').children('a').append(function() {
            return '<button class="sub-nav-toggler"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>';
          });
          $('.site-header .navbar-nav .sub-nav-toggler').on('click', function() {
            var Self = $(this);
            Self.parent().parent().children('.sub-menu').slideToggle();
            return false;
          });
        }
      });
    })(jQuery);

    Warm regards,
    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.