Re: Javascript load problem?
You could try something like this. Alter it to fit it back into your project. I took what you posted and edited it just a bit.
HTML Code:
<html>
<head>
<title>Image Browser</title>
<script language="javascript">
var imgCount = 3;
img1 = new Image();
img1.src="apple_1.jpeg";
img2 = new Image();
img2.src="apple_2.jpeg";
img3 = new Image();
img3.src="apple_3.jpeg";
var images = new Array;
images[1] = img1;
images[2] = img2;
images[3] = img3;
var x = 1;
function loadImage(int){
x += (int);
if(x > imgCount){x = 1;}
if(x < 1){x = imgCount;}
imgPicture.src = images[x].src;
frmMain.txtImageName.value = images[x].src;
}
</script>
</head>
<body bgcolor="#59307E" color="white">
<div>
<img id = "imgPicture" src = "apple.jpeg" />
</div>
<div>
<form id = "frmMain">
<input type = "button" value = "Next" onclick = "loadImage(1);" />
<input type = "button" value = "Previous" onclick = "loadImage(-1);" />
<br />
<input type = "text" size = "100" id = "txtImageName" value = "" />
</form>
</div>
</body>
</html>