Hamburger icon does not change back after closing mobile menu

I have a Navigation Collapsed element in my header that will serve as a vertical mobile navigation menu. My theme uses a single page system where all of the sections are hidden except for the active section. Because the page doesn’t refresh when these links are clicked, the menu doesn’t close when a link is clicked, so I had to write some JS that does this. The problem now is that the anchor toggler doesn’t change the icon back to the hamburger menu icon, it stays as the X icon. I tried removing the x-active class from it, since that is the only thing that seems to change when you click on it the first time, but that doesn’t do anything. How can I change the toggle icon back to the hamburger menu icon? Here is my JS:

$('.x-menu-collapsed .menu-item a').on('click', function(e){
    $('.x-anchor').removeClass('x-active')
    $('#e33-4-off-canvas').hide();
  })

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.