I made a mini social network like facebook, or twitter, however I wanted not to load the contents directly. The scroll works well and it loads the contents except that when it is loading and the user scrolls, I can no longer respond to comments or take an action on a post published by a user.
I thought my was code wrong but it is by adding the infinity scroll that this bug occurs.
I know it's not easy at all to debug as you don't have a rendering of what I did, but if at least you have an idea behind your head I'm open to other scroll proposals infinite.
Here is the explanation page: https://docs.infiniteajaxscroll.com/getting-started
here my code in php:
$postParPage = 1;
$postTotalesReq = $pdo->query('SELECT id FROM p_membrealpha');
$postTotales = $postTotalesReq->rowCount();
$postTotales = ceil($postTotales/$postParPage);
if(isset($_GET['page']) AND !empty($_GET['page']) AND $_GET['page'] > 0 AND $_GET['page'] <= $postTotales) {
$_GET['page'] = intval($_GET['page']);
$pageCourante = $_GET['page'];
} else {
$pageCourante = 1;
}
$depart = ($pageCourante-1)*$postParPage;
In js:
<script>
var ias = new InfiniteAjaxScroll('#container_scroll', {
item: '.post_in',
next: '.suivant',
pagination: '#pagination'
});
ias.extension(new IASSpinnerExtension({
text: 'Chargement...'
}));
</script>