scrollSpy-Class输入点的额外像素

时间:2015-07-06 08:54:31

标签: jquery

我在我的网站上使用了scrollSpy(https://github.com/thesmart/jquery-scrollspy)。不幸的是,一些部门的进入位置是早期的。是否有可能添加一些额外的像素,以便f.e.进入/退出会稍晚一点?我尝试谷歌,但无法找到任何东西。

1 个答案:

答案 0 :(得分:0)

您可以在options object for the plugin,$ .scrollSpy = function(选择器,选项)中设置顶部偏移量:

//config object with say 100px top offset
var options = {
    "offsetTop" : 100
};

//usage
$.scrollSpy(SELECTOR, options);