My issue involves a responsive menu with Bootstrap. On desktop, the menu closes fine; however, on the responsive view, I want it to close when clicking outside of the nav menu in any area. Here is my navigation code:
<!-- Navigation -->
<nav id="navigation-sticky" class="white-nav b-shadow">
<!-- Navigation Inner -->
<div class="nav-inner">
<div class="logo">
<!-- Navigation Logo Link -->
<a href="#home" class="scroll">
<!-- Your Logo -->
<img src="" class="site_logo" alt=""/><br>
</a>
</div>
<!-- Mobile Menu Button -->
<a class="mobile-nav-button colored"><i class="fa fa-bars"></i></a>
<!-- Navigation Menu -->
<div class="nav-menu clearfix ">
<ul class="nav uppercase oswald">
<li><a href="#home" class="scroll">home</a></li>
<li class="dropdown-toggle nav-toggle" ><span href="#about" class="scroll">About App<b data-toggle="dropdown"></b></span>
<!-- DropDown Menu -->
<ul class="dropdown-menu uppercase gray-border clearfix">
<li><a href="#works" class="scroll">HOW DOES IT WORK?</a></li>
<li><a href="#features" class="scroll">Features</a></li>
<li><a href="#what-we-do" class="scroll">APP FLOW</a></li>
<li><a href="#faq" class="scroll">F.A.Q</a></li>
</ul>
<!-- End DropDown Menu -->
</li>
<li><a href="#portfolio" class="scroll">Service Types</a></li>
<li><a href="#skills" class="scroll">Cities</a></li>
<li><a href="#prices" class="scroll">Rates</a>
</li>
<li><a href="#download" class="scroll">Download</a></li>
<li class="dropdown-toggle nav-toggle" ><span aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle scroll">Become a Driver</span>
<!-- DropDown Menu -->
<ul class="dropdown-menu uppercase gray-border clearfix">
<li><a href="#" class="scroll">Signup</a></li>
<li><a href="#" class="scroll">Flyer</a></li>
</ul>
<!-- End DropDown Menu -->
</li>
<li><a href="#" class="scroll">login</a></li>
<li><a href="#contact" class="scroll">contact</a></li>
</ul>
</div><!-- End Navigation Menu -->
</div><!-- End Navigation Inner -->
</nav><!-- End Navigation -->
Although the script I'm using successfully closes the menu, I'm encountering an issue where double-clicking is required instead of single-clicking to open the menu.
$('html').click(function() {
$('#menu').hide();
});