Created
November 19, 2012 16:03
-
-
Save beckenkamp/4111471 to your computer and use it in GitHub Desktop.
Scroll Pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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