Want to see infinite scroll in action?

Aurgasm.us ROFLCon Tinyways

The Interaction Design Pattern

Infinite scroll has been called autopagerize, unpaginate, endless pages. But essentially it is pre-fetching content from a subsequent page and adding it directly to the user’s current page.

Problem Summary:

User is browsing paged content.

Use When:

  • Retaining the user is important and clicking “Next Page” is a usability barrier.
  • The full content available is too large to show on initial load.
  • The content is available in paged chunks: search results, blog posts, product listings portfolio features.

Advantages:

  • Users are retained on the site far better.
    • Users are less likely to continue on to the next “page” if they have to click something versus it being delivered automatically to them. [citation needed]
  • Requires no adjustment in a user’s typical reading habits.
  • The added functionality needs no affordances or instruction.
  • As long as the functionality is enhancing an existing navigational structure (like the wordpress plugin here), it remains SEO-friendly and Accessible. It will degrade gracefully if a user does not have JavaScript enabled..

Disadvantages:

  • The “footer” of the page will be typically impossible to reach.
  • Currently there is no way to cancel or opt-out of the behavior.
  • There is no permalink to a given state of the page.
  • Dynamically adding more content to the page increases the memory footprint of the browser. Depending on the browser, this could account for around 50megs of RAM.
  • Analytics will not immediately capture the event, so custom configuration is required.

Implementation Recommendations:

  • Depending on site latency, new content can be fetched aggressively (when a user has 500px of the page left to scroll) versus at the last moment (with ~100px left).
  • User should be notified when there is no more content available.
  • Consider a faux pagination widget to allow for navigation within the new content. Travis Isaacs has ideas on a running pagination.
  • Infinite scroll should be implemented as progressive enhancement. Typical navigation/pagination should be present for users with javascript disabled. Javascript-enabled users, however, will experience the more rich reading functionality.

Examples in the wild:

Wordpress Plugin Installation

  1. Download the plugin.
  2. Install it to your /wp-content/plugins/ directory
  3. Activate the plugin in your Wordpress Admin UI.
  4. Visit the Settings / Infinite Scroll page to set up the css selectors.
  5. The plugin will now work for a logged in Admin, but will be disabled for all other users; you can change this.

CSS Selector Setup

You need configure the plugin with CSS selectors that match your theme.

Content CSS Selector
The DIV that wraps around all posts. New posts will be inserted at the bottom of this DIV.
Post CSS Selector
The selector that selects all posts on a page. Each post must be surrounded by a single DIV.
Navigation links CSS Selector
This DIV contains the Next Posts and Previous Posts link.
Previous Posts CSS Selector
This A tag is what points to the 2nd page of posts.

Troubleshooting

  • Your posts need to be wrapped in divs all next to each other.
  • You need a link on your page to the next page of posts.

FAQ

Can I change the number of posts loaded?
Yup. But that’s a Wordpress thing. Go to Settings / Reading
Is it SEO-Friendly?
Yes all enhancements are made via javascript only, so search spiders see no difference.
Is it accessible?
Things won’t change for screen-readers. This technique degrades gracefully.
Why doesn’t it work on ____ page?
Currently, the plugin is disabled for everything but the main page, but I’ll work on enabling it for Archives, Categories, and Tags.
Does it still keep going, even at the end of the blog?
Infinite scroll is configured to die when it hits a 404 Not Found status code, so when it goes through all your archives it should hit a /page/43/ (or something) that doesn’t exist, then show a message “Congrats, you’ve reached the end of the internet.” Some wordpress themes don’t report not found pages with a 404. Try a different theme or contacting the theme author.
Do I need to edit my theme to make this work?
Probably not, nope.
Will this do form posts for get new data?
Nope?
You must it just works?
Yup.
Really?
I hope so. But due to the infinitudes of wordpress installations, each case is different. Different themes and other plugins may break infinite scroll’s functionality.

Customization

This information will probably help styling.

  • <div id="infscr-page-2" class="infscr-pages"> will contain the page 2 content, etc
  • <div id="infscr-loading"> is the loading div.

Changelog

  • 2008 June 29 - 1.0 release.
  • 2008 September 25 - 1.1 release.
    • Rewritten as a jQuery plugin.
    • Added animation.