Ok a simple problem (I hope)… I have a few images that preload. When i call the script fo the image to load i want to be able to determine the height of the image being loaded. The problem arises when I want the image to load randomnly.
[CODE]
Image1= new Image(478,400)
Image1.src = “http://www.mysite.com/image1.jpg”
Image2 = new Image(368,400)
Image2.src = “http://www.mysite.com/image2.jpg”
var maxpics = 2;
var picheight
function picload() {
if (randnum > maxpics) {
randnum = 1;
}
var newimg = [“Image”+randnum].src; <—-//I know this is wrong, this is where I am stuck…
picheight= newimg.height;
}
i want picheight to return the height of the random img source. I don’t know how to combine the variables so it will work or not come out undefined. Thanks in advance for any help.