-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full pre-loaded JSON #673
Comments
Yes! You can use Infinite Scroll v3's var $container = $('.container').infiniteScroll({
// path is required, hack with {{#}}
path: 'page{{#}}',
loadOnScroll: false,
});
// create & append HTML on scrollThreshold event
$container.on( 'scrollThreshold.infiniteScroll', function() {
var postsHTML = getPostHTML() + getPostHTML() + getPostHTML();
$container.append( postsHTML );
}); See demo https://codepen.io/desandro/pen/6c58dd231fee361558c6a3764dc355c1 |
awesome! thanks, that is exactly what I needed. |
@bite-your-idols Any chance you could post your code utilizing json? |
it is part of a huge project but the steps are these: Maybe it is a cleaner or better way but this works ok. I hope this helps you. |
@bite-your-idols great steps! and How do you add imagesLoaded inside scrollThreshold event? or where would you use it when it has 700 img using a unique json? |
Is there any way of use infinite scroll without calling URLS? I mean I have a full JSON loaded in my app (no pagination available) but I want to show it as user scrolls down using masonry. I have a "pagination" method by parsing and splitting this JSON in html snippets saved in js for each "page" but I can't make it work with infinite-scroll since it is expecting a URL...
The text was updated successfully, but these errors were encountered: