Currently, I am not utilizing JavaScript to toggle the hamburger menu. Instead, I am relying on Bootstrap's built-in functionality for opening and closing it.
Here is my HTML code:
<div class="container">
<h3 class="brandname">
<a href="javascript:void(0);" style="font-family: 'Inter', sans-serif; font-weight: 600;">Raffle<span>Hive</span></a>
</h3>
<a class="navbar-brand" href="javascript:void(0);"></a>
<button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample01" aria-controls="navbarsExample01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarsExample01" style="">
<ul class="navbar-nav ms-auto align-items-center">
<li class="nav-item">
<a class="nav-link active jumper" style="font-family: 'Inter', sans-serif; font-weight: 500;" aria-current="page" href="#home">Home</a>
</li>
<li class="nav-item ms-2">
<a class="nav-link jumper" style="font-family: 'Inter', sans-serif; font-weight: 500;" href="#features">Features</a>
</li>
<li class="nav-item ms-2">
<a class="nav-link jumper" style="font-family: 'Inter', sans-serif; font-weight: 500;" href="#statistics">Statistics</a>
</li>
<li class="nav-item ms-2">
<a class="nav-link jumper" style="font-family: 'Inter', sans-serif; font-weight: 500;" aria-current="page" href="#plans">Plans</a>
</li>
<li class="nav-item ms-2">
<a class="nav-link jumper" style="font-family: 'Inter', sans-serif; font-weight: 500;" href="#faq">FAQ</a>
</li>
<li class="nav-item ms-3">
<a class="nav-link btn btn-primary py-1 px-4" style="font-family: 'Inter', sans-serif; font-weight: 500;" href="#">Dashboard</a>
</li>
</ul>
</div>
</div>
The menu should close when the user clicks anywhere outside of it (below in this instance) rather than exclusively clicking the hamburger icon.
I suspect I will need to incorporate some JavaScript, but I'm unsure where to begin.