更改onBefore-LocalScroll jQuery插件中的偏移量
我正在使用Ariel Flesler的localScroll插件,一切正常。不过我有一个问题。我无法找到如何从onBefore中更改偏移参数 e、 g更改onBefore-LocalScroll jQuery插件中的偏移量,jquery,offset,scrollto,Jquery,Offset,Scrollto,我正在使用Ariel Flesler的localScroll插件,一切正常。不过我有一个问题。我无法找到如何从onBefore中更改偏移参数 e、 g 如果有人能提供帮助,我将不胜感激:)onBefore设置可以使用this.someSetting将值返回到设置 考虑到这一点,您可以执行以下操作: $('#htmlObject').localScroll({ onBefore: function(){ if(something){ t
如果有人能提供帮助,我将不胜感激:)onBefore设置可以使用
this.someSetting
将值返回到设置
考虑到这一点,您可以执行以下操作:
$('#htmlObject').localScroll({
onBefore: function(){
if(something){
this.offset = someNumber;
}
}
});
因此,您已经拥有的解决方案几乎可以工作,您只需将offset.top
替换为this.offset
,您就可以看到您正在寻找的结果
$('#htmlObject').localScroll({
onBefore: function(){
if(something){
this.offset = someNumber;
}
}
});