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
  • 34,719
  • 24
  • 185
  • 251
Millzie
  • 302
  • 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
  • 385
  • 5
  • 16