0

this is the jQuery I use for my mobile navigation, what I am trying to do is make the menu close again after clicking anywhere. So that when I visit a intern link it does not stay open. Can anyone please help me? Thanks for your time.

(function ($) {
  var $mobileNavToggleBtn = $('.mobile-nav-toggle');

  function onBtnClick (e) {
    var $this = $(this),
        $selectors = $('.mobile-nav');

    $this.toggleClass('is-open');
    $selectors.toggleClass('is-open');
  }

  $(document).ready(function () {
    $mobileNavToggleBtn.on('click', onBtnClick);
  });
})(jQuery);
Cylion
  • 89
  • 8

0 Answers0