mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Database requests
This commit is contained in:
parent
f41312248c
commit
594431b420
8 changed files with 84 additions and 42 deletions
|
@ -12,10 +12,10 @@
|
|||
let imageList = [];
|
||||
let imageIndex = 0;
|
||||
|
||||
function loadMore(startIndex, amount = 10) {
|
||||
function loadMore(startIndex, amount = 20) {
|
||||
for (let i = startIndex; i < startIndex + amount; i++) {
|
||||
if (i < imageList.length) {
|
||||
loadImg(i, imageList[i]);
|
||||
loadImg(imageList[i][0], imageList[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,13 +41,13 @@
|
|||
success: function(response) {
|
||||
imageList = response;
|
||||
|
||||
loadMore(0, 20);
|
||||
imageIndex += 20;
|
||||
loadMore(0, 30);
|
||||
imageIndex += 30;
|
||||
}
|
||||
});
|
||||
|
||||
$(window).scroll(function() {
|
||||
if ($(window).height() + $(window).scrollTop() >= $(document).height() - 200) {
|
||||
if ($(window).height() + $(window).scrollTop() >= $(document).height() - 500) {
|
||||
loadMore(imageIndex);
|
||||
imageIndex += 10;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue