html - 向上/向下滚动时菜单/顶部栏发生变化

标签 html css zurb-foundation

<分区>


想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post .

关闭 7 年前

我搜索了所有地方,但找不到解决方案,当用户向下滚动时,网站的菜单选项会发生变化。有谁知道如何做到这一点(最好是在 Foundation 中)?

最佳答案

您的问题非常广泛 - 您可能想解释您想要的内容。但是我认为您可能正在寻找“粘性”标题效果,例如:http://themenectar.com/demo/salient/

如果是这种情况,Foundation 论坛上的这篇帖子 ( http://foundation.zurb.com/forum/posts/18987-sticky-header-effect) 提到您可以使用类 'sticky' 来实现相同的效果。

In Foundation the same effect can be achieved by wrapping the navbar in a div class="sticky".

As soon as an element with the "sticky" class hits the top of the viewport it gets the class "fixed", which takes care of the positioning. You can also use this class to resize the "stuck" navbar etc.

关于html - 向上/向下滚动时菜单/顶部栏发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36392953/

上一篇:javascript - 网页 Jquery 下拉按钮不起作用

下一篇:html - 根据其中的@media 删除或调整不同 div 的图像大小?

相关文章:

html - IE 和 FF 中的相对和绝对定位

html - 无法更改 CSS 导航栏高度

html - 具有定义的 css 类的导航菜单,当我将 ID 属性添加到 li 标签时中断

css - Puppeteer 保存的 PNG 不透明

firebug - FireQuery Firebug 附加组件破坏 Foundation 5 在 OSX 上显示

jquery - Superscrollorama onPin 弄乱了我的布局

javascript - Microsoft Edge 无法在 SVG 上设置数据属性

css - 自动行高 - 忽略第一项的高度

c# - 将一些html导出到excel文件时如何防止css丢失?

javascript - Foundation Abide - 如果先前的输入无效,则在有效输入上触发无效错误