Skip to content

Commit

Permalink
fix for support.md auto-incremental javascript example
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Mar 20, 2019
1 parent 1f376d4 commit 119ba78
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions docs/extras/support.md
Expand Up @@ -104,17 +104,14 @@ We can implement it by using the same [Incremental example](#navlessincremental)

```js
var loadNextPage = function(){
if ($('#next_link').data("loading")){ return } // prevent multiple loading
var wBottom = $(window).scrollTop() + $(window).height();
var elBottom = $('#records_table').offset().top + $('#records_table').height();
if (wBottom > elBottom && $('#next_link_pagy').attr('href')){
$('#next_link')[0].click()
$('#div_next_link_pagy').html('')
if (wBottom > elBottom){
$('#next_link')[0].click();
$('#next_link').data("loading", true);
}
};

window.addEventListener('load', loadNextPage);
window.addEventListener('resize', loadNextPage);
window.addEventListener('scroll', loadNextPage);
```

### Circular/Infinite
Expand Down

0 comments on commit 119ba78

Please sign in to comment.