0

I'm working on pre loading images and I am trying to load 1 through 40 but its not working :( here is the code:

function preload(arrayOfImages){
 $(arrayOfImages).each(function(){
  (new Image()).src = this;
 });
};preload(['/img/wallpapers/'images 1 to 40'.jpg']);
Cœur
  • 37,241
  • 25
  • 195
  • 267
Millzie
  • 312
  • 1
  • 3
  • 13

1 Answers1

1
function preload(arrayOfImages){
 $(arrayOfImages).each(function(){
  (new Image()).src = this;
 });

 for(i=1;i<=40;i++)
  preload('/img/wallpapers/'images' + i + '.jpg');
StartCoding
  • 394
  • 5
  • 16