Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/03/2011, 18:48
Avatar de Paramericano
Paramericano
 
Fecha de Ingreso: agosto-2010
Mensajes: 137
Antigüedad: 13 años, 8 meses
Puntos: 8
Respuesta: Script que te cambia la imagen cada x horas

Hola a todos, he encontrado este código por la web:

Código:
<script language="JavaScript">
day=new Date()     //..get the date
x=day.getHours()    //..get the hour
if(x>=0 && x<4) {
   document.write('<style type="text/css">body{background: white url(1st.jpg); color: black}"></style>')
} else
if(x>=4 && x<12) {
   document.write('<style type="text/css">body{background: white url(2nd.jpg); color: black}</style>')
} else
if(x>=12 && x<18) {
   document.write('<style type="text/css">body{background: white url(3rd.jpg); color: black}</style>')
} else
if (x>=18 && x<24) {
   document.write('<style type="text/css">body{background: white url(4th.jpg); color: black}</style>')
}
</script>
Va de maravilla, muchas gracias a todos, espero que le pueda servir a alguien