# How to create an infinity scroll? (Stack pages vertically)

**URL:** <https://forum.readymag.com/t/how-to-create-an-infinity-scroll-stack-pages-vertically/3065>\
**Category:** Custom code\
**Created:** [June 11, 2024, 7:55pm UTC](https://forum.readymag.com/t/how-to-create-an-infinity-scroll-stack-pages-vertically/3065 "2024-06-11T19:55:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Pacola](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.readymag.com/joao_pacola/32/1545_2.png) [@Joao\_Pacola](https://forum.readymag.com/u/Joao_Pacola)\
**Post date:** [June 11, 2024, 7:55pm UTC](https://forum.readymag.com/t/how-to-create-an-infinity-scroll-stack-pages-vertically/3065/1 "2024-06-11T19:55:20Z")

</div>

I am using the “Stack all pages vertically” option and I would like it to seamlessly go back to the first page once it reaches the last page, creating an infinite scroll effect. I tried applying some JS code to achieve this, but it didn’t work. Does anyone have a code for this or any workaround to achieve this effect?

Thanks

---

<div class="post-metadata">

**Author:** ![neueMeta](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.readymag.com/neuemeta/32/92_2.png) [@neueMeta](https://forum.readymag.com/u/neueMeta)\
**Post date:** [June 24, 2024, 8:38am UTC](https://forum.readymag.com/t/how-to-create-an-infinity-scroll-stack-pages-vertically/3065/2 "2024-06-24T08:38:47Z")

</div>

this might be pretty hard to implement.

With custom code you could set up a observer if an element is in view. so that if this element, for example the footer is in view jump to the beggining of the page. But it might be a bit confusing and wouldn´t be the infinite scroll behaviour you might want to achieve…
