Jump to content

Recommended Posts

Posted

The infinite scrolls drive me nuts. :) But I agree it would be fun to see how one has implemented this.

  • Like 1
Posted

Depends on the situation. I think for a status/time POV like Twitter or Facebook an infinate scroll is a very good solution, but one has to think very carefully how to implement this. I've seen this being used on newspages and mostly it's just a fancy solution for a problem that's doesn't exist.

  • Like 1
Posted

Step 1. create a PW template like this:

<?php
    if($input->get->offset){
         $results = $pages->find('template=articles,start='.$offset.',limit=20');
    }

    foreach($results as $item){?>
         <li><?=$item->body?></li>
          .... your html here ....
    <?php }?>

Step 2. In the page that you want infinite scroll, do something like this in JS

.... when the user scrolls to the bottom...
$('body').append('<div id="section"></div>');
$('#section').load('/path-to-my-page-with-template/?offset=40');
... Figure out how many items you want to load, calculate your offset ...

None of this is production code. Just trying to show the concept.

  • Like 1
  • 2 weeks later...
Posted

Thanks for the comments. I implemented infinite scroll on a development site, but after seeing it in action, my client decided not to use it.

If I implement this functionality on a live site in the future, I'll be sure to share my experience. Thanks again.

Posted

I'm using a nice variation of the infinite scroll

http://www.fieg.nl/i...a-jquery-plugin

This plugin it's really easy to use, it doesn't requires any particular modification in the code because it uses the pagination links to generate the infinite scroll, in this way also google is happy because I generate my content with pagination as usual and the users have the enhanced version.

  • Like 6
  • 5 months later...
Posted

I've been wrapping my head around infinite ajax scroll from the most of last night. I had it working, although I can't seem to reach the end of the pages. If I have 4 pages, it would scroll up to page 3 and won't show the 4th page. I'm not quite sure why.

Posted

@Macrura, yes it does, all the pages shows up correctly when accessed by /page#. I also tried changing the limit, and it's the same. The content of the last page doesn't load. 

Posted

any javascript errors or warnings in the console, when you try to get it to load the last page? Must be a js issue

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...