-
Notifications
You must be signed in to change notification settings - Fork 552
Open
Labels
Description
Hello,
I am using jscroll on a search page in a laravel app and it doesn't work all the time. Sometimes jscroll doesn't load the second page, I can see from the telescope that the jscroll has requested for the second page and that the app has returned a valid response. However, jscroll doesn't add the new content in the view and keeps on showing the loading html. I have attached an image of the developer tool's console log when the result does not load in the view.
My jscroll js implementation looks like this.
window.addEventListener('load', initSearch);
function initSearch() {
searchJScroll();
}
function searchJScroll() {
const html = '<div class="text-muted align-items-center text-center"><i class="fas fa-2x fa-spinner fa-spin"></i> Loading...</div>';
const options = {
debug: true,
autoTrigger: true,
loadingHtml: html,
padding: 0,
nextSelector: '.pagination li.active + li a',
contentSelector: '.jScroll',
pagingSelector: '.pagination',
callback: function () {
$('ul.pagination').remove();
}
};
$('.jScroll').jscroll(options);
}Any insight would be greatly appreciated. Thanks.
