Good day all I have had this issue for a while now and can't find really good updated techniques to create the infinite scroll and pagination function where clicking 'load more' loads entries beneath until there are no more entries. I need some simple code that would make this work, currently my code basically just gives me entries on a new page but i want it to load on the same page beneath each other. Has anyone succesfully achieved this hassle free?
Who ever has the correct answer I will tell the world of your tale and everyone else will call you king/queen of EE Pagi-Nation! Here is my terrible coding below!
PS: I have tried justin long's method and it did not work for me, I mailed him too.
<div class="col" id="blog-container">
{exp:channel:entries
channel="blog"
dynamic="no"
orderby="date"
limit="2"
status="open|tall|regular"
paginate_base="embed/ajax_scroll"
}
{if no_results}
<div class="entry">
<article style="min-height: 600px;">
<header>
<h1>No Results</h1>
</header>
Check back soon for more blog posts.
</article>
</div> <!-- /.entry -->
{/if}
<div class="entry">
<article>
<header>
{title}
</header>
{blog_summary}
</article>
</div> <!-- /.entry -->
{paginate}
<p class="morePosts">
{if next_page}<a href="{auto_path}" class="more" id="next">See More Posts</a>{/if}
</p>
{/paginate}
{/exp:channel:entries}
</div> <!-- /.col -->
<script type="text/javascript" src="/httpdocs/static/js/jquery.infinitescroll.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#blog-container').infinitescroll({
navSelector : "p.morePosts",
nextSelector : "a.more",
itemSelector : ".entry",
contentSelector: "#blog-container",
extractLink: true // This is crucial if you want it work properly. Setting this to false or excluding it will not allow the script to work with EE
})
});
// Unbind normal behavior
$(window).unbind('.infscr');
// Bind normal behavior to the click function and prevent the browser from redirecting to the URL.
$('a#next').click(function(){
$(document).trigger('retrieve.infscr');
return false;
});
</script>
</div>