R
roN
Hi,
I have 3 small images and 3 big images, i would like to display the big one,
when the small one is clicked, I tried:
[js]
IA1 = new Image();
IA1.src = "./images/IA-demo-big_1.jpg"; /* first big IA image */
IA2 = new Image();
IA2.src = "./images/IA-demo-big_2.jpg"; /* second big IA image */
IA3 = new Image();
IA3.src = "./images/IA-demo-big_3.jpg"; /* third big IA image */
function switchpic(pic)
{
window.document.images['big'].src = IA[pic].src;
}
[/js]
but it wouldn't work, why not?
I'd appreciate your help!
Thank you!
I have 3 small images and 3 big images, i would like to display the big one,
when the small one is clicked, I tried:
[js]
IA1 = new Image();
IA1.src = "./images/IA-demo-big_1.jpg"; /* first big IA image */
IA2 = new Image();
IA2.src = "./images/IA-demo-big_2.jpg"; /* second big IA image */
IA3 = new Image();
IA3.src = "./images/IA-demo-big_3.jpg"; /* third big IA image */
function switchpic(pic)
{
window.document.images['big'].src = IA[pic].src;
}
[/js]
HTML:
<td width="23%"><a href="#"
OnClick="switchpic(1)"><img src="images/IA-demo-small_1.jpg" width="63"
height="95" border="0"></a></td>
<td colspan="3" rowspan="3"><img
src="images/IA-demo-big_3.jpg" name="big" width="193" height="290"></td>
</tr>
<tr>
<td><a href="#" OnClick="switchpic(2)"><img
src="images/IA-demo-small_2.jpg" width="63" height="95"
border="0"></a></td>
</tr>
<tr>
<td><a href="#" OnClick="switchpic(3)"><img
src="images/IA-demo-small_3.jpg" width="63" height="95"
border="0"></a></td>
</tr>
but it wouldn't work, why not?
I'd appreciate your help!
Thank you!