A sticky Top Bar makes the page jump up when scrolling past it with Zurb Foundation

前端 未结 4 1374
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 06:47

I am using the Zurb Foundation 4 framework for my site. I want to have a navbar that is positioned beneath a header that sticks to the top of the page when you scroll past.

4条回答
  •  我在风中等你
    2021-01-13 07:23

    This appears to be a hard-coded "feature" in Foundation 4's Javascript. Instead of merely preventing the default behavior of the link, it automatically forces the link to redirect to #, which causes the browser to jump to the top of the page. This appears to be intentional (more on that in a second).

    The only alternative for now is to just not use the Top Bar component and create your own navigation using other, more reliable Foundation components. For instance, you can build your own navigation easily enough using both the .sticky class and simply defining a fresh

提交回复
热议问题