Snip3r_bow Snip3r_bow - 6 months ago 14
jQuery Question

Add divs to sections without breaking the scrolling

I'm making this website here, and I'm using

sections
in order to have that smooth scrolling effect you see there.

I now need a
navigation bar
, but if I put it before the
sections
(so out of them) it happens that everytime I scroll there's a short cropstrong text of the section before in the new section.

Instead if I put it inside, the
height
of it won't display correctly.

So my question is: how can I insert that nav bar without breaking up the scrolling efect so it will display the full section each time?

Answer

Try adding "position:fixed" to the navigation bar and add padding from top to the sections equal to the height of the navigation bar.

After inspecting you website :This is what you need to do

#cssmenu {
    background: #8EBEBC;
    width: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9;
}
#fullpage{ 
    padding-top:58px;
}

and you are good to go.

Thanks