Q:

PJAX Scroll Loading

I'm working on a news publishing site that needs to load in stories from an RSS feed below the current news page.  I've been using InfiniteAjaxScroll (http://infiniteajaxscroll.com/) to some success however, I've hit a brick wall.  There is not way for me to dynamically change what story should load in next as you scroll down the page.
Does anyone know of any other plugins, tutorials, examples that replicate behavior like this.  I've searched but come up with nothing that meets these requirements.
I'm trying to create something similar to what the Daily Beast has implemented on their site.
http://www.thedailybeast.com/articles/2014/11/05/inside-the-democrats-godawful-midterm-election-wipeout.html
How do they know what stories to load in?
Thanks!

A:

If you're using the InfiniteAjaxScroll library, the "next story" is whatever link you define as the next URL which can be dynamic for each story you load.
Imagine your first story's HTML as something like this
<div class="stories">
  <div class="story">
    ...
  </div>
</div>

<div id="pagination">
    <a href="storyC.html" class="next">next</a>
</div>

Then in the storyC.html you have
...
<div id="pagination">
    <a href="storyG.html" class="next">next</a>
</div>

Assuming you're using some sort of dynamic backend, you would use some sort logic to grab a related story and just set that URL as the "next" URL.

