I'm struggling with getting the sticky-top function to work properly. To work around the issue, I ended up writing some messy javascript code, but I'm hoping someone might have a better idea. My goal is to have the element stick to the top of the screen as I scroll past another element on the page at a 50px offset.
The navbar appears to look and function correctly (as shown in the image) but I suspect this could be a user error situation...
<body data-spy="scroll" data-target=".navbar" data-offset="50">
<nav class="navbar navbar-default navbar-fixed-top" id="secondNav">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Portfolio</a>
</div>
<div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="#section1">Section 1</a></li>
<li><a href="#section2">Section 2</a></li>
<li><a href="#section3">Section 3</a></li>
<li><a href="#section4">Section 4</a></li>
</ul>
</div>
</div>
</div>
</nav>