Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/02/2010, 04:25
wwwRamon
 
Fecha de Ingreso: septiembre-2009
Mensajes: 19
Antigüedad: 14 años, 7 meses
Puntos: 0
Busqueda ¿Cómo puedo añadir a mi web una galeria fotográfica con JavaScript?

Hola, querría saber cómo hacer una gleria fotográfica para mi web en JavaScript, pero no se como. De momento he pensado en esto:
Código HTML:
<html>
<head>
<title>Photo Gallery</title>
<script>
document.getElementById("photo").style.backgroundImage = "url(1.jpg)";
function changephoto()
{
if (document.getElementById("photo").style.backgroundImage = "url(1.jpg)"){
document.getElementById("photo").style.backgroundImage = "url(2.jpg)";
}
else{
if (document.getElementById("photo").style.backgroundImage = "url(2.jpg)"){
document.getElementById("photo").style.backgroundImage = "url(3.jpg)"
}
else{
if (document.getElementById("photo").style.backgroundImage = "url(3.jpg)"){
document.getElementById("photo").style.backgroundImage = "url(1.jpg)"
}
}
}
}
</script>
<body>
<div id="photo" onclick="changephoto();"></div>
</body>
</html> 
Pero no funciona, por favor ayuda!!!!
Gracias por adelantado