Os dejo la ultima modificación del código:
Código Javascript
:
Ver original1.
<html>
2.
<head>
3.
<title>Intercambiador de Imagenes</title>
4.
</head>
5.
<body>
6.
<img src="img/img0.JPG" width="128" height="96" border="0" name="Imagen">
7.
<script>
8.
var _img = new Array();
9.
_img[0] = new Image(); _img[0].src="img/img0.jpg";
10.
_img[1] = new Image(); _img[1].src="img/img1.jpg";
11.
_img[2] = new Image(); _img[2].src="img/img2.jpg";
12.
_img[3] = new Image(); _img[3].src="img/img3.jpg";
13.
function cambiarA(_obj)
14.
{
15.
if(!_obj)return;
16.
var _index = _obj.selectedIndex;
17.
if(!_index)return;
18.
var _item = _obj[_index].value;
19.
if(!_item)return;
20.
if(_item<0 || _item >=_img.length)return;
21.
document.images["Imagen"].src=_img[_item].src;
22.
}
23.
</script>
24.
25.
<form method="get">
26.
<select onchange="cambiarA(this)">
27.
<option value="">Seleccionar Imagen</option>
28.
<option value="0">Imagen 1</option>
29.
<option value="1">Imagen 2</option>
30.
<option value="2">Imagen 3</option>
31.
<option value="3">Imagen 4</option>
32.
</select>
33.
</form>
34.
35.
</body>
36.
</html>