It works great but if you click a link the the back button it shows an error:
'myPics' is undefined
from:
var myImages = new Array ("Home.jpg", "HomeRoll.jpg"); var myPreload = new Array (); for (var i = 0; i < myImages.length; i++ ) { myPreload[ i ]= new Image(); myPreload[ i ].src = myPics[ i ]; }
Can anybody help me with this please or tell me why the error is occuring. What is the variable myPics even for?
I would appreciate any help.
Seems like something got mixed up. myImages should be the same as myPics. But of course i don't which one was the original name.
Either change all occurances from myImages to myPics or change all occurances from myPics to myImages.
Code:
var myImages = new Array ("Home.jpg", "HomeRoll.jpg");
var myPreload = new Array ();
for (var i = 0; i < myImages.length; i++ ) {
myPreload[ i ]= new Image();
myPreload[ i ].src = myImages[ i ];
}