I am encountering an issue with preloading images.
for(y=0;slide_image.lenght;y++){
for(x=0;slide_image[y].lenght;x++){
var preload_image=new Image();
preload_image.src=slide_image[y][x];}
}
When I use preload_image.src=slide_image[x]
alone, it works fine. But when I combine the two, it doesn't. Could this be a JavaScript bug?
Here is the slide_image
array:
var slide_image = new Array();
slide_image = [
['1/1.png', '1/2.jpg', '1/3.jpg', '1/4.jpg', '1/5.png'],
['2/text_1.png', '2/1.jpg', '2/2.jpg', '2/3.jpg', '2/4.jpg', '2/5.jpg', '2/6.jpg', '2/7.jpg'],
['3/1.jpg', '3/2.jpg', '3/3.jpg', '3/4.jpg', '3/5.jpg', '3/6.jpg']
];
Firebug and Firefox debugger are not showing any errors. I am unable to figure out why this code is not working.