1

I'm following another developer on a site and trying to speed it up. The functionality requires many entries to be displayed within a single document object. Previously, load times were abysmal so I've switched to pagination and I'm trying to implement infinite scroll to allow the rest of the pages to show in the same document object.

It seems as though every thing is working correctly until infinite scroll tries to load the new pages. Once you scroll to the bottom it tries to load something but says it cant.

What am I missing here? Code to set it up is:

<div id="timeline">
{exp:channel:entries channel="stories" orderby="story_year" dynamic="no" limit="20" paginate="bottom"}
    <article class="largeArticle gold"> ...
    </article>

    {paginate}
    {if next_page} 
        <div class="navigation">
            <a href="{auto_path}" class="next">Show More</a>
        </div>
    {/if}
    {/paginate}
{/exp:channel:entries}
</div>

And the javascript is:

<script type="text/javascript">
  $(document).ready(function(){
        $("#timeline").infinitescroll({
            navSelevtor : ".navigation",
            nextSelector : "a.next",
            itemSelector : ".post",
            extractLink: true,
        });
  });
</script>

You can see this in action at http://thinkx.net/clients/manship/index.php/timeline.

Thanks for your help, I'm really stuck here.

3
  • 1
    BTW, on the speed side the biggest issues are slow shared hosting, and bad use of EE code. The site still loads slowly for me due to a long time-to-first-byte (almost 3 secs on a refresh). Pagination will help, but you've got a bigger underlying problem. – Paul Mar 16 '13 at 20:03
  • Yeah, I'm working behind someone. This is not the way I'd set up a site with EE, but it's faster to patch up the previous work than to redo all of it. – thatgibbyguy Mar 25 '13 at 19:43
  • Yes, it's hard to patch up someone else's work, all the best with it. – Paul Mar 26 '13 at 13:59
0

The problem is with my code when calling infinitescroll().

The itemSelector needs to be the information that EE loops out. So in this case, it should be:

itemSelector : ".largeArticle"

Now, all I need to do is get the footer timeline to work with it at the same time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.