How to implement load previous items like infinite ajax scroll history example

1.2k Views Asked by At

currently I'm trying to use infinite ajax scroll function with my posts.

Here I want to make a link to load previous items like implemented on infinite ajax scroll history example here: http://infiniteajaxscroll.com/examples/history/page3.html (see Load more items above the content.)

My code:

Javascript:

<script type="text/javascript">
    var ias = jQuery.ias({
        container: '#posts',
        item: '.post',
        pagination: '#pagination',
        next: '.next'
    });

    ias.extension(new IASSpinnerExtension({src: 'ajax-loader.gif'}));
    ias.extension(new IASTriggerExtension({offset: 2}));
    ias.extension(new IASPagingExtension());
    ias.extension(new IASHistoryExtension({prev: '.prev a'}));
</script>

HTML Markup

<div id="posts">
    <div class="post">...</div>
    <div class="post">...</div>
</div>

<div id="pagination">
    <a href="/page2/" class="next">next</a>
</div>

I have tried with jQuery.ias().prev(); method but they have no clear documentation to impelement this.
Does someone know what wrong with my code? Thank you!

0

There are 0 best solutions below