我想通过将体/html框架按任意数量向顶级/顶级进行模拟。 我知道j Query scroll或亲密功能,.scroll(
和.animate(
)。 但是,我决定不使用这一条,因为它在<条码> scrollTop上造成财产在<条码>、条码/代码>和<条码>上发生冲突。 j an 发生和仍在进行之中的Qu土功能,< scroll被称作。
现在,我的计划是,通过将体/html框架尽可能平稳地以某种任意数量进行模拟,然后在出现本地的<代码>croll(scroll(<>.scroll(>
)时,STOP(缩短间隔)。
在<代码>.scroll()时,我可以停止<代码>Interval animation,但我仍然无法将html的标语排在首位,而我想要的是“scroll”(这意味着我只读了部分作品)。
这就是我迄今为止所做的事情:
var scrollTop = //Some arbitrary value
var fakeScroll = setInterval(function(){
console.log(scrollTop);
var animObj = $( html,body );
animObj.top = animObj.offset().top + scrollTop;
},500);
$(document).scroll(function(){
clearInterval(fakeScroll);
});
赞赏任何建议/答复。 感谢!