I am completely new to front-end development. I am in the process of building my own responsive website using Bootstrap 3.
One issue I am facing is that when I resize my browser window to simulate a phone screen, I want the navigation bar color to change to white upon clicking the Menu Icon.
Currently, the header stays transparent on page load and changes to white while scrolling, as intended. However, when I click the hamburger menu icon, the collapsible nav header drops down with the menu items but the background remains transparent, causing the menu items to overlap the content below.
I have attempted to write a script to address this issue, but it doesn't seem to be working. Can anyone provide any suggestions?
<script>
var windowsize = $(window).width();
$(window).resize(function() {
windowsize = $(window).width();
if (windowsize < 440) {
$("#myNavbar").click(function () {
$(".navbar-header").css({"background-color": "#ffffff", "-webkit-box-shadow": "0px 1px 4px 0px rgba(180, 180, 180, 0.5)", "-moz-box-shadow": "0px 1px 4px 0px rgba(180,180,180, 0.5)", "box-shadow": "0px 1px 4px 0px rgba(180,180,180, 0.5)"});
});
};
});
</script>