-4

I have recordings and photos folder for my personal website. I want to write code so that it will automatically go through the directory and display the images on the website

I've tried looking at a bunch of solutions already on SO but the problems weren't similar to mine and I couldn't understand the code to change it into what I need.

pasha
  • 406
  • 1
  • 4
  • 17
  • 1
    Possible duplicate of [How to load all the images from one of my folder into my web page, using Jquery/Javascript](https://stackoverflow.com/questions/18480550/how-to-load-all-the-images-from-one-of-my-folder-into-my-web-page-using-jquery) – Marc Hjorth May 27 '19 at 05:13

1 Answers1

-1

You can try this code here

where 736 in the loop is the total images.

jQuery('document').ready(function() {
  var imgPath='images/';
  var imgExtinction='.jpg';

  var html='<ul>';
  for(var i=1; i<=736; i+=1){
    var imgNumber = getFourDigitNumber(i);
    var Image =imgPath+imgNumber+imgExtinction;
    html+=('<li><span class="overlay"></span> <img src="'+Image+'" /></li>');
  }
  jQuery('#images').append(PDFHTML+'</ul>');

});
Md. Abu Sayed
  • 2,396
  • 2
  • 18
  • 26