Select Img Viwer em JavaScript
- Código:
<script language="javascript">
/*Combo Box Image Selector:
By Website Abstraction (www.wsabstract.com)
Over 200+ free JavaScript here!
*/
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"><p><select
name="picture" size="1" onChange="showimage()">
<option selected value="URL-DA-IMAGEM">Imagen 1</option>
<option value="URL-DA-IMAGEM">Imagen 2</option>
<option value="URL-DA-IMAGEM">Imagen 3</option>
</select></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="IMAGEM-ORIGINAL" name="pictures" width="100%"
height="100%"></td>
</tr>
</table>
URL-DA-IMAGEM = Substitua pelas imagens que estaram a selecionar.
IMAGEM-ORIGINAL = Substitua pela imagem original que ficara ao nao selecionar nada.
Resultado: Este codigo cria uma selectbox que lhe permite visualizar a imagem correspondente a opçao selecionada.