Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 html/css/javascript 中获得多行无限循环、滚动画廊?
基本思想是,当您到达列表的末尾时(取决于您滚动的方向),抓住列表的第一个元素并将其附加到当前可视化的元素之后,这样您将从头开始。
如果您滚动到右侧或底部,则必须抓住列表开头的元素并将其放在列表的末尾。
如果您滚动到左侧或顶部,您必须抓住列表的最后一个元素并将其放在列表的首位。
这是实现无限滚动的一种非常简单的方法。