0

I've got a wordpress site I'm working on that's a few years old, (but up to date...as much as possible), and uses the "Expound" theme.

It is supposed to be responsive, but the nav bar isn't functioning correctly. When the display is less than 600px wide the nav bar menu collapses, as it should. The problem is that the menu doesn't extend when you click on the collapsed "menu".

I just want to know what needs to be done to actually show that nav bar on a mobile device/smaller screen.

I'm more than happy to provide code snippets, but I'm not exactly sure where the problem is.

This is what my reset.css file contains (which is what is responsible for the collapsing action):

    /* Small menu */
.menu-toggle {
    display: none;
    cursor: pointer;
}

.main-small-navigation ul {
    display: none;
}

@media screen and (max-width: 600px) {
    .menu-toggle,
    .main-small-navigation ul.nav-menu.toggled-on {
        display: block;
    }

    .navigation-main ul {
        display: none;
    }
}
AmericanMade
  • 453
  • 1
  • 9
  • 22

1 Answers1

0

I made a basic hamburger menu using vanilla javascript:

Javascript:

var menu = document.getElementById("menu-fluke-catalog-1")
var toggler = document.querySelectorAll(".menu-toggle")[0];
toggler.addEventListener("click", function (event) {
    if (! menu.classList.value.includes("open")){
        // Menu will open
        menu.classList.add("open");
    } else {
        // Menu will close
        menu.classList.remove("open");
    }
});

CSS:

@media screen and (max-width: 600px) {
    .menu-toggle,
    .main-small-navigation ul.nav-menu.toggled-on {
        display: block;
    }

    .navigation-main ul {
        display: none;
    }
    .navigation-main ul.open {
        display: block;
    }
    /* don't use the next one if you want a more condensed menu*/
    .navigation-main ul.open li {
        display: block;
        width: 100%;
    }
}

Check if the funtionality works for you, if you want it more condense you could delete the .navigation-main ul.open li style rule.

Fecosos
  • 944
  • 7
  • 17