javascript – Can’t find the correct class to close the one-pager WP site mobile menu when anchor link is clicked


could someone help me maybe? I have a one-pager WP site, menu includes anchor links to different parts of the page. The problem is, the mobile/hamburger menu stays open, when anchor links are clicked. I tried to research and fix the problem by applying the code below, that would remove specific class (that is set when the menu is opened) when any link is clicked inside the mobile menu.

But I can’t get it to work.

Here’s the site:

and here’s the code:

jQuery(function($) {
    $(".bdt-offcanvas li a").on("click", function(e){

Any help or pointing to right direction is highly appreciated.

Ville Ekman 1 year 2023-01-06T07:17:44-05:00 0 Answers 0 views 0

Leave an answer