I am trying to manipulate images based on mouseover. I'm not close yet; but my first step is to display an image from an array.
Where have I gone wrong in this snippet?I have tried several variations on this , so it may be worse than my original effort
<SCRIPT language="JavaScript1.2">
//var x=0
var r=1
alert (r)
var photos = new Array(
new Array("Images/MarH0022V.jpg", "Images/MarH0022T.jpg","Images/MarH0022C.jpg"),
new Array("Images/NicM0421V.jpg","Images/NicM0421T.jpg",null),
new Array("Message-3W.jpg", null,null),
new Array("Message-1W.jpg","Message-3W.jpg",null)
);
//var bigimg= new Image()
var bigimg=(photos[1][0])
alert (bigimg)
/*function blowup(r)*/
var imgSrc = new Array();
for(x=0;x<photos.length;x++){
imgsrc[x] = new Image();
imgsrc[x].src =photos[x][0]
}
alert (x)
eval(document.getElementsByName("bigimg").src = imgsrc[r].src)
</SCRIPT></HEAD>
<BODY bgcolor="#474747">
<TABLE width="478" border="1" cellspacing="0" cellpadding="0" cool gridx="16" gridy="16" height="343" showgridx showgridy usegridx usegridy>
<TBODY>
<TR height="32">
<TD height="342" rowspan="4" width="268"><IMG name=bigimg src=http://www.webdeveloper.com/forum/archive/index.php/"Images/MarH0022V.jpg"></TD>
Where have I gone wrong in this snippet?I have tried several variations on this , so it may be worse than my original effort
<SCRIPT language="JavaScript1.2">
//var x=0
var r=1
alert (r)
var photos = new Array(
new Array("Images/MarH0022V.jpg", "Images/MarH0022T.jpg","Images/MarH0022C.jpg"),
new Array("Images/NicM0421V.jpg","Images/NicM0421T.jpg",null),
new Array("Message-3W.jpg", null,null),
new Array("Message-1W.jpg","Message-3W.jpg",null)
);
//var bigimg= new Image()
var bigimg=(photos[1][0])
alert (bigimg)
/*function blowup(r)*/
var imgSrc = new Array();
for(x=0;x<photos.length;x++){
imgsrc[x] = new Image();
imgsrc[x].src =photos[x][0]
}
alert (x)
eval(document.getElementsByName("bigimg").src = imgsrc[r].src)
</SCRIPT></HEAD>
<BODY bgcolor="#474747">
<TABLE width="478" border="1" cellspacing="0" cellpadding="0" cool gridx="16" gridy="16" height="343" showgridx showgridy usegridx usegridy>
<TBODY>
<TR height="32">
<TD height="342" rowspan="4" width="268"><IMG name=bigimg src=http://www.webdeveloper.com/forum/archive/index.php/"Images/MarH0022V.jpg"></TD>