I have a nav-bar that starts at about 200 pixels at the top of the page when loading. When I scroll down, I would like the nav-bar to βsnapβ to the very top of the page and be visible when I view the rest of the content. I can make nav-bar stay in place, although 200px is on top, and it ignores the content I pulled out and pulls it all to the left. I have to make sure that the navigation bar remains visible and that the layout / style is the same all the way.
below is my jsfiddle which shows that i have problems with
<header class="masthead"> <div class="row"> <div class="span6"> <div class="logo pull-left"> <h1><a href="/">name</a></h1> </div> </div> <div class="span6"> <div class="pull-right hidden-phone"> <form class="search" action="/search" id="site-search"> <input type="hidden" name="records" value="6"> <div class="input-append"> <input type="text" name="q" class="search_box" placeholder="Search" value="" autocomplete="off" /> <button class="btn" type="submit"><i class="icon-search"></i></button> </div> </form> </div> </div> </div> </header> <div> <div class="navbar navbar-static"> <div class="navbar-inner" id="mastnav"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <div class="nav-collapse collapse"> <ul class="nav"><li><a href="#">nav</a> </li></ul> <ul class="nav pull-right"> <li> <a href="/cart"><i class="icon-shopping-cart"></i> <span id="cart-count">1</span></a> </li> </ul> </div> </div> </div> </div> </div>
JSFIDDLE
twitter bootstrap
Paul 'Whippet' McGuane
source share