I've written this js so the menu is responsive but doesn't break when js is not enabled.
I have 2 menu lists each inside their own nav element. For tablet and mobile devices I want only a menu button (first item in the list with ) to show but no list until the menu button is pressed.
At the moment the first list hides on opening the page but the other list is permanently showing. However, clicking either menu button does the same job of showing the first list. Neither nav has an id or class.
Why is only one of the lists responding?
This is the JS (its in the head)
function showLists() {
$('.nav').show();
$(".menu").hide();
}
$(document).ready(function() {
if ($(window).width() < 450) {
$('.nav').hide();
$(".menu").click(function () {(
showLists()
)})
}
});