Hello, I want to load images as the user scrolls down, and my idea was:
When the user arrives on website load first 20 images from the database, once the user scrolled down, send an ajax call to load more, but not sure how to tell the code to load +10 images.
My idea would be to add a stage variable, and as the user scrolls down, increment it, for example, reached the bottom one, stage+1 => stage = 2 send that through the ajax call and in go do stage * 10 = 20, then with mysql, load the default 10 or 20 images + the result of the stage which is 20 here, so a total of 40, then send the response to ajax, empty the page and append all of the images again
Or, count the loaded image with jquery and send the number to Go and when loading from mysql, skip that number of images.