S
S
sandrin12018-09-21 10:16:24
User navigation
sandrin1, 2018-09-21 10:16:24

How to close mobile menu when clicking on empty space?

/*  Hamburger Menu & Icon  */
  $('.hamburger').on('click', function(e){
    
    e.preventDefault();
    $(this).toggleClass('opned');
    $('header nav').toggleClass('active');
    
  });

it is clear that 2 classes are assigned opned and active
<header>
      <div class="wrapper">
                              <div class="logo">
        <a href="tel: +79997583571">+7 (999) 756-25-71</a>
</div>
        <a href="#" class="hamburger"></a>
        <nav class="">
          <ul>
            <li><a href="#">Buy</a></li>
            <li><a href="#">Rent</a></li>
            <li><a href="#">Sell</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
          </ul>
        </nav>
      </div>
    </header>

help! So that when you click on an empty space, these classes are deleted?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question