Ver Mensaje Individual
  #145 (permalink)  
Antiguo 09/09/2003, 06:26
Avatar de epa2
epa2
 
Fecha de Ingreso: abril-2002
Ubicación: Málaga
Mensajes: 1.475
Antigüedad: 22 años, 7 meses
Puntos: 9
147.- Mensaje segun hora del día

P: ¿COMO PUEDO MOSTRAR UN MENSAJE EN MI PAGINA DEPENDIENDO DE LA HORA DEL DIA?

R:Con este pequeño script

CREDITOS BRAVENET

Código:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<div align='center' style='font:bold 14px verdana;'>")
day = new Date()
hr = day.getHours()
if (hr == 1) document.write("It's after 1 am. Are you still up?")
if (hr == 2) document.write("It's after 2 am. Are you still up?")
if (hr == 3) document.write("It's after 3 am. Are you still up?")
if (hr == 4) document.write("It's after 4 am. Are you still up?")
if (hr == 5) document.write("It's after 5 am. Are you still up?")
if (hr == 6) document.write("It's after 6 am, yawn!")
if (hr == 7) document.write("Good Morning! It's after 7 am")
if (hr == 8) document.write("It's after 8 am")
if (hr == 9) document.write("It's after 9 am")
if (hr == 10) document.write("It's after 10 am, coffee time!")
if (hr == 11) document.write("It's after 11 am")
if (hr == 12) document.write("It's after noon")
if (hr == 13) document.write("Good Afternoon! It's after 1 pm")
if (hr == 14) document.write("It's after 2 pm")
if (hr == 15) document.write("It's after 3 pm")
if (hr == 16) document.write("It's after 4 pm")
if (hr == 17) document.write("Good Evening! It's after 5 pm")
if (hr == 18) document.write("It's after 6 pm, eat some dinner!")
if (hr == 19) document.write("It's after 7 pm")
if (hr == 20) document.write("It's after 8 pm")
if (hr == 21) document.write("It's after 9 pm")
if (hr == 22) document.write("It's after 10 pm")
if (hr == 23) document.write("It's after 11 pm, go to bed!")
if (hr == 0) document.write("It's after midnight.")
document.write("</div>")
// End -->
</SCRIPT>
__________________

***Aprendiz de todo y maestro de nada***

Última edición por Kaopectate; 24/05/2004 a las 15:00