I think jQuery's waypoints are a plugin that you might need:
http://imakewebthings.com/jquery-waypoints/
Below you can name the waypoint plugin:
$(document).ready(function() { var $loading = $("<div class='loading'><p>Loading more items…</p></div>"), $footer = $('footer'), opts = { offset: '100%' }; $footer.waypoint(function(event, direction) { $footer.waypoint('remove'); $('body').append($loading); $.get($('.more a').attr('href'), function(data) { var $data = $(data); $('#container').append($data.find('.article')); $loading.detach(); $('.more').replaceWith($data.find('.more')); $footer.waypoint(opts); }); }, opts); });
source share