【问题标题】:Sticky topbar not working Zurb Foundation粘性顶栏不起作用 Zurb Foundation
【发布时间】:2013-07-08 06:43:13
【问题描述】:

我从 Foundation 阅读了很多反对使用 topbar 的内容。喜欢

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

这里

https://github.com/zurb/foundation/issues/2005

对我来说这很“不稳定”。有时有效,有时无效

这是我的代码http://jsfiddle.net/qhoc/48Tur/1/

我是这样激活的吗?

$(document).foundation().foundation('topbar');

任何线索为什么这个不粘?

【问题讨论】:

    标签: javascript jquery css zurb-foundation


    【解决方案1】:

    Here is a working fiddle。你错过了一些css

    .sticky{
        position:fixed;
        z-index:999;
    }
    .cuisine {
        margin-top:50px;
    }
    

    【讨论】:

    • 不知何故我认为 topbar.js 应该添加它。行动!
    • 那么,顶栏固定类和粘性类有什么区别呢?
    【解决方案2】:

    将此添加到您的 CSS 中

    .sticky{
        position:fixed;
        z-index:999;
    }
    .cuisines{
        margin-top:50px;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-09
      • 2014-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多