Hello all programmers!
I want to preload 60 images. There are 20 jpegs with 3 variations each. The images are named ovn1_niv1, ovn1_niv2, ovn1_niv3, ovn2_niv1... So instead of writing almost the same lines 60 times I want to preoload them with two loops. I hoped that this would work but it doesn’t. Anyone have any ideas?
for (i=1; i<=20; i++){
for (j=1; j<=3; j++){
eval("var ovn"+i+"niv"+j+" = new Image()"
;
eval("ovn"+i+"niv"+j+".src"
= eval("ovn"+i+ "/niv"+j+
"/ovn"+i+"_niv"+j+".jpg"
;
}
}
I want to preload 60 images. There are 20 jpegs with 3 variations each. The images are named ovn1_niv1, ovn1_niv2, ovn1_niv3, ovn2_niv1... So instead of writing almost the same lines 60 times I want to preoload them with two loops. I hoped that this would work but it doesn’t. Anyone have any ideas?
for (i=1; i<=20; i++){
for (j=1; j<=3; j++){
eval("var ovn"+i+"niv"+j+" = new Image()"
eval("ovn"+i+"niv"+j+".src"
"/ovn"+i+"_niv"+j+".jpg"
}
}