fixed navbar not collapsing properly when selecting

This commit is contained in:
Ell 2023-07-09 14:03:32 +02:00
parent 697a607d53
commit 54e17968b5

View file

@ -12,15 +12,12 @@
<img src="/media/icon.png" width="40" height="40" alt="The Tiny Life logo"> <img src="/media/icon.png" width="40" height="40" alt="The Tiny Life logo">
</a> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-content" aria-label="Navbar toggler"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-content"
aria-label="Navbar toggler">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbar-content"> <div class="collapse navbar-collapse" id="navbar-content">
<script>
$(".navbar-collapse a").on("click", () => $(".navbar-collapse").collapse("hide"));
</script>
<div class="navbar-nav mr-auto" id="nav-items"> <div class="navbar-nav mr-auto" id="nav-items">
{% if page.nav %} {% if page.nav %}
{% include {{ page.nav }} %} {% include {{ page.nav }} %}
@ -42,6 +39,10 @@
}); });
</script> </script>
</span> </span>
<script>
$(".navbar-collapse a").on("click", () => $(".navbar-collapse").collapse("hide"));
</script>
</div> </div>
</div> </div>
</nav> </nav>