I have designed a navigation bar that will only be visible on larger screens.
<nav id="sidebar" class="d-none d-lg-block">
...
</nav>
In addition, I have implemented a toggle feature that allows the user to show or hide the navbar by clicking on an icon.
<a href="#" onclick="$('#sidebar').toggle();"><i class="fa fa-bars custom-icon"></i></a>
However, I am facing an issue where the navbar does not hide when I click on the icon. It seems that the display: none;
property is not taking effect due to the use of d-none d-lg-block
.
https://i.sstatic.net/NSlAm.png
Does anyone know how I can resolve this problem?