Skip to content

Instantly share code, notes, and snippets.

@beckenkamp
Created November 19, 2012 16:03
Show Gist options
  • Select an option

  • Save beckenkamp/4111471 to your computer and use it in GitHub Desktop.

Select an option

Save beckenkamp/4111471 to your computer and use it in GitHub Desktop.
Scroll Pagination
var processing;
var next_page = 2;
jQuery(document).ready(function($){
$(document).scroll(function(e){
if (processing)
return false;
if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.9){
processing = true;
$.post('tela_de_retorno',
{
'page':next_page
},
function(data){
next_page++;
$('#resultados tbody').append(data);
processing = false;
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment