<p>To produce an &quot;infinite scroll&quot; like behavior, you'll need to go further than just pagination with TWIG. You'll need to implement some JavaScript. Metafizzy's <a href="https://github.com/metafizzy/infinite-scroll" rel="nofollow noreferrer">Infinite Scroll</a> might be appropriate.</p>
<p>This question has answers that could help you: <a href="https://craftcms.stackexchange.com/questions/2842/infinite-scrolling-with-craft/6621">Infinite scrolling with Craft?</a></p>

CC BY-SA 4.0
2021-04-07T21:33:47.930Z
2021-04-07T21:33:47.930Z
John
<p>I'm not good in programming and I stuck on making infinite scroll on my website.</p>
<p>Right now I have the code for pagination that looks like this:</p>
<pre><code>    {% set query = craft.entries()
    .section('articles')
    .type('naujienos')
    .limit(15)
     %}

{% paginate query as pageInfo, pageEntries %}

{% for entry in pageEntries %}
   {% include 'blocks/_article-with-text.three'  %}
{% endfor %}

&lt;/div&gt;

{% if pageInfo.prevUrl %}&lt;a href=&quot;{{ pageInfo.prevUrl }}&quot;&gt;Previous Page&lt;/a&gt;{% endif %}
{% if pageInfo.nextUrl %}&lt;a href=&quot;{{ pageInfo.nextUrl }}&quot;&gt;Next Page&lt;/a&gt;{% endif %}
</code></pre>
<p>It's very much the same as in Craft CMS documentation and I checked all the topics that are in here but couldn't make it work for me. Maybe someone can help me out please?</p>

<pagination>
Inifinite scroll
# Inifinite scroll

(Asked by: username_0 on 2021-04-06)

I'm not good in programming and I stuck on making infinite scroll on my website.
Right now I have the code for pagination that looks like this:
    {% set query = craft.entries()
    .section('articles')
    .type('naujienos')
    .limit(15)
     %}

{% paginate query as pageInfo, pageEntries %}

{% for entry in pageEntries %}
   {% include 'blocks/_article-with-text.three'  %}
{% endfor %}



{% if pageInfo.prevUrl %}Previous Page{% endif %}
{% if pageInfo.nextUrl %}Next Page{% endif %}

It's very much the same as in Craft CMS documentation and I checked all the topics that are in here but couldn't make it work for me. Maybe someone can help me out please?

**Tags:** pagination

---

## 1 answers

### Answer by username_1 on 2021-04-07. Score: 1

To produce an "infinite scroll" like behavior, you'll need to go further than just pagination with TWIG. You'll need to implement some JavaScript. Metafizzy's [Infinite Scroll](https://github.com/metafizzy/infinite-scroll) might be appropriate.

This question has answers that could help you: [Infinite scrolling with Craft?](https://craftcms.stackexchange.com/questions/2842/infinite-scrolling-with-craft/6621)


---

