What I am trying to do is make the nav bar stay at the top of the page when you scroll past it. As I am quite new to JavaScript I looked a few tutorials, however, none of them really worked with the Bootstrap nav bar. I was just wondering if there was a way to do this so that it works with the Bootstrap columns.
Also how could I make it so that while it's scrolling, the background colour starts to fade in?
Here is the HTML code for the nav bar, in case that helps:
<div class="container">
<nav class="navbar navbar-default" id="mNavbar">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" id="toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#section2">Services</a></li>
<li><a href="#section3">Contact</a></li>
</ul>
</div>
</div>
</nav>
</div>