Created
November 15, 2017 19:23
-
-
Save beckysoll/bf47047c56f5de427dd3abaee22344c2 to your computer and use it in GitHub Desktop.
using infinite scroll in a statamic collection/entries loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ entries limit='6' paginate='true' as='articles' }} | |
<div class="items-wrap"> | |
{{ if show_title=='true' }} | |
<h2 class="group-title"><a href="{{ url }}">{{ title }}</a></h2> | |
{{ /if }} | |
<div class="items"> | |
{{ articles }} | |
<div class="item"> | |
entry stufffff | |
</div> | |
{{ /articles }} | |
</div> | |
{{ paginate }} | |
{{ if next_page }} | |
<div class="view-more bottom-link"> | |
<button class="more-items">View More</button> | |
<p style="display: none;"> | |
<a href="{{ next_page }}" class="more-items-link">Next</a> | |
</p> | |
</div> | |
{{ /if }} | |
{{ /paginate }} | |
</div> | |
{{ /entries }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.items-list .items').infiniteScroll({ | |
path: '.more-items-link', | |
append: '.item', | |
button: '.more-items', | |
scrollThreshold: false, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment