开发者

Fixed left nav & fixed header issue

开发者 https://www.devze.com 2023-01-20 04:02 出处:网络
At this site I have a fixed nav and header when user clicks a title on nav it takes the开发者_C百科m to proper content box.Yet when they click from \"Just Kids,\" to \"Home,\" the top content is hidde

At this site I have a fixed nav and header when user clicks a title on nav it takes the开发者_C百科m to proper content box. Yet when they click from "Just Kids," to "Home," the top content is hidden behind the fixed header. Also you will notice this happens when the page loads; content is hidden behind the fixed header.

I've tried a few things; added a div with height to push content down as seen here but here when page loads the right content area is pushed down.

Has anyone seen a site like this before or have a suggestion on how to fix the above?


Anchors behave this way. When you jump to an anchor it's going to attempt to go to the top of the screen.

Seems like you're using Javascript already for that smooth scroll effect. During the effect, instead of scrolling to the anchor, prevent the default action, get the top offset of the anchor, and scroll to (that top offset - the header height)

0

精彩评论

暂无评论...
验证码 换一张
取 消