css - Scroll skipping h2 -


using bootstrap, have nav nav-list below:

<ul class="nav nav-list hidden-phone hidden-tablet" data-spy="affix" data-offset-top="299">         <li><a href="#about">about green panda</a></li>          <li class="divider"></li>         <li><a href="#logo">logo & brand</a></li>          <li class="divider"></li>         <li><a href="#">contact us</a></li>          <li class="divider"></li>         <li><a href="#">press</a></li>          <li class="divider"></li>         <li><a href="#">work us</a></li>       </ul> 

the href linked h2 on page. when click on link skips h2 , doesn't display when scroll it. have created js fiddle here: http://jsfiddle.net/ynrwp/

i can not figure out how fix this. believe has fixed navbar can't figure out is. i'm wanting (notice header @ top of each section: http://twitter.github.io/bootstrap/scaffolding.html#global

when browser scrolls h2, doesn't take account header floating on top of it. can work around adding "padding-top" h2's. try add this...

h2 { padding-top: 50px; }


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -