I created a database where I store all the images' names so that I can retrieve it later on. To retrieve the images' names, I use ajax and bind it with <img> tag:
$.post('image_name.php',{id:id}, function(data){
$('#container').html('<img src="img/'+data+'">');
});
Everything works great. But what I noticed was, all the images shows up at the same time which slows the process a little bit. Therefore, I am thinking that the best way to handle this issue is to use lazy load. I want any data that is ready to be displayed.... but I do not know how to.
Additonal Info: I am trying to create a list of thumbnails. Just like the Imgur sidebar (https://i.sstatic.net/BbtPn.jpg)