Closed nolaandy closed 7 years ago
@nolaandy
I copied your code and tested it. Strange, but menu was closing when clicking on links, although still worked not entirely correctly.
Code data-toggle="offcanvas" data-target=".navmenu"
, that you've added for each link in menu, closes menu, but prevents link from applying. I removed this code, so that each link looked like this: <a href="/events" class="<?php if @(is_page('events')) echo 'active'; ?>">
.
Then links work ok, and menu is closing correctly by the JS code you've added for this:
jQuery("#navA .navmenu-nav a").click(function(){
jQuery('.navmenu').offcanvas('hide');
});
Here is a jsfiddle
Closing, as solution of problem was just to remove code data-toggle="offcanvas" data-target=".navmenu"
from menu links
I'm developing a site http://maypoprestaurant.com/location
On mobile ( < 768px ), after collpasing the off-canvas navigation via the hamburger icon, I need the off-canvas navigation to close up once one of its links is clicked. As it is now, a mobile user must click the hamburger >nav link > then click off the sidebar in order to send it back offcanvas.
Any help would be GREATLY appreciated as I'm pulling my hair out over here. :x
I've added this Javascript in the header: