So I created a foreach loop like below, and it's loading in images from the server a couple hundred of em and I want it to load more images as I scroll down the page so it's not loading all the hundreds of images at once.
<div id="container">
<?php foreach(glob("img/WeddingCakes/*.*") as $filename){ ?>
<div class="item"><img src="img/WeddingCakes/<?php echo basename($filename) . "\n"; ?>" alt=""></div>
<?php } ?>
</div>
All the images are stored in a database.
Any suggestions on how I would go about adding an infinite scroll?