Código HTML:
<script type="text/javascript"> function showPic (whichpic) { if (document.getElementById) { document.getElementById('imgContenedor').src = whichpic.href; if (whichpic.title) { document.getElementById('imgDescripcion').childNodes[0].nodeValue = whichpic.title; } else { document.getElementById('imgDescripcion').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; } return false; } else { return true; } } </script>
Código HTML:
<ul> <li><a onclick="return showPic(this)" href="URL_imagen1" title="texto_imagen_1">1</a></li> <li><a onclick="return showPic(this)" href="URL_imagen2" title="texto_imagen_2">2</a></li> <li><a onclick="return showPic(this)" href="URL_imagen3" title="texto_imagen_3">3</a></li> </ul> <div id="imgDescripcion">el texto inicial</p> <img id="imgContenedor" src="URL_imagenInicial" />
Funciona bien, pero quisiera modificarlo de la siguiente manera;
que al hacer clic, en el numero me muestre la imagen deseada, el titulo correspondiente y ademas que me muestre unos comentarios que deseo poner. son tres cosas en diferentes divs, ahora solo muestra la imagen y el titulo.
Muchas gracias de antemano por su ayuda