我想在侧边栏上使用 bootstrap 的词缀插件。然而,由于我的网站是响应式的,它总是在某些维度上跳跃,我无法让它正常工作。我尝试了此处列出的解决方案:How to use the new affix plugin in twitter's bootstrap 2.1.0?但它不只是工作。
我知道如何在固定宽度的网站上执行此操作,但由于我的网站是响应式的 bootstrap 文档也是如此,因为它完美运行 there ,如何达到同样的效果?
因为这可能永远都行不通
.affix {
position: fixed;
top: 20px;
right: 10%;
}
最佳答案
当我使用它时,我的 .affix
类只有 position:fixed
,没有别的。可以使用 offset
选项在 affix()
方法中设置附加元素的顶部位置,例如
$("#nav_id").affix({
offset: 400
});
关于javascript - Bootstrap 词缀总是 "jumping",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13644266/