简体   繁体   English

整个页面的Javascript循环滚动

[英]Javascript Looping Scroll for entire page

I would like to create the following effect, but do not know if it is achievable the way I envisage. 我想产生以下效果,但是我不知道这种效果是否可以实现。

I would like a html page that is 2 or 3 times bigger than the screen and is scrollable (in itself nothing special). 我想要一个比屏幕大2到3倍且可滚动的html页面(本身没有什么特别的)。 But when you reach the bottom I want it to automatically go back to the top seemlessly. 但是,当您到达最低点时,我希望它会自动回到最高点。

The end result I would like is if you held down the down arrow button the page would keep looping and scrolling down. 我想要的最终结果是,如果您按住向下箭头按钮,页面将继续循环播放并向下滚动。

I want it to be continuous, not just jump back up to the top and start over. 我希望它是连续的,而不仅仅是跳回到顶部并重新开始。

You need to make a second copy of your contents and stick it after the original. 您需要再复制一次内容,并将其粘贴在原始内容之后。 When "frame one" of the second copy gets to the edge of the screen, reset the positioning back to zero. 当第二个副本的“第一帧”到达屏幕边缘时,将位置重置为零。 This way it appears to be like a seamless loop. 这样看来就像一个无缝循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM