1

I'm creating an JPEG image sequence in JS. Now, I'm trying to create a function that will preload the images from the directory assets/img/frames/...

Is there a way I can load everything from within the directory into an array and loop through it to check whether the image is loaded or not? I'm trying to avoid writing each individual file into the array since there are 500+ images.

Thanks,

Enzio Rossa
  • 125
  • 1
  • 1
  • 11
  • possible duplicate of [Preloading images with jQuery](http://stackoverflow.com/questions/476679/preloading-images-with-jquery) – A. Rama Apr 20 '15 at 08:05
  • You cannot list local files in js: http://stackoverflow.com/questions/6994212/is-there-a-way-to-return-a-list-of-all-the-image-file-names-from-a-folder-using and for preloading images: http://stackoverflow.com/questions/476679/preloading-images-with-jquery – A. Rama Apr 20 '15 at 08:07
  • The (first) link posted by @A.Rama combined with this: [How to load all the images from one of my folder into my web page, using Jquery/Javascript](http://stackoverflow.com/a/18480589/4728655) - might do the trick. – Sidd Apr 20 '15 at 08:07
  • Interesing, that's a nice trick to read the directory content without needing a backend script. – A. Rama Apr 20 '15 at 08:48

0 Answers0