2

Lots of separate issues here that I want to figure out so apologies for lots of recent posts ;)

I have infinite scroll working on my site (other issues we won't mention) yet the whole thing seems to fire too quickly, especially before the pagination exists.

This is what I have:

<script src="<?php bloginfo('template_directory'); ?>/js/jquery.infinitescroll.min.js"></script>
<script>
  $(function(){

var $container = $('.rest-of-content');

  $container.infinitescroll({
    navSelector  : '.wp-paginate',    // selector for the paged navigation 
    nextSelector : '.wp-paginate li a',  // selector for the NEXT link (to page 2)
    itemSelector : '.single-fg-post',     // selector for all items you'll retrieve
    bufferPX: 20,
    loading: {
      msgText: 'Fetching more gold...',
      finishedMsg: 'Damn! No more gold!',
      img: '<?php bloginfo('template_directory'); ?>/images/ajax-loader-black.gif'
    }
});

  });
</script>

Yet, if you look at the way it works: http://goo.gl/L9p00 - if you scroll down a little, you can see the scrollbar slider shorten as it loads the content before I have even reached it.

2
  • Btw, design work and UX here is gorgeous. Kudos. I'd hire you.
    – Josh Smith
    Commented Dec 29, 2011 at 2:38
  • Thanks man! How kind of you to say! Been working on it for a few months now just on and off between other projects with the launch due in spring. Thanks again! Commented Dec 29, 2011 at 11:55

1 Answer 1

1

There is nothing wrong with this. It's working exactly as intended. You want the page to render before hitting the bottom because you don't want the user to have to wait. Your servers can take the hit. Your users can't stand the wait.

Take a look at Pinterest to see the exact same thing in action.

2
  • 1
    Without having a look at the code in depth, that's what I assumed the intention was. It's better UX to have it load as you get close to the bottom of the page so by the time you get there it's loaded, than it is to wait once you've reached the bottom.
    – djlumley
    Commented Dec 29, 2011 at 2:47
  • I see your point, but at the same time, as a web admin you do not want your site to load page after page of items. Commented Jan 10, 2013 at 6:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.