Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/02/2010, 17:14
Avatar de CHuLoSoY
CHuLoSoY
 
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 22 años, 10 meses
Puntos: 29
Respuesta: Ayuda con código para cambar el texto dependiendo de la hora

Con conocimientos básicos de html podrías hacer esto:
Código Javascript:
Ver original
  1. document.write("<div align='center' style='font:bold 14px verdana;'><font color='white'>")
  2. day = new Date()
  3. hr = day.getHours()
  4. if (hr == 1) document.write("It's after 1 am. Are you still up?")
  5. if (hr == 2) document.write("It's after 2 am. Are you still up?")
  6. if (hr == 3) document.write("It's after 3 am. Are you still up?")
  7. if (hr == 4) document.write("It's after 4 am. Are you still up?")
  8. if (hr == 5) document.write("It's after 5 am. Are you still up?")
  9. if (hr == 6) document.write("It's after 6 am, yawn!")
  10. if (hr == 7) document.write("Good Morning! It's after 7 am")
  11. if (hr == 8) document.write("It's after 8 am")
  12. if (hr == 9) document.write("It's after 9 am")
  13. if (hr == 10) document.write("It's after 10 am, coffee time!")
  14. if (hr == 11) document.write("It's after 11 am")
  15. if (hr == 12) document.write("It's after noon")
  16. if (hr == 13) document.write("Good Afternoon! It's after 1 pm")
  17. if (hr == 14) document.write("It's after 2 pm")
  18. if (hr == 15) document.write("It's after 3 pm")
  19. if (hr == 16) document.write("It's after 4 pm")
  20. if (hr == 17) document.write("Good Evening! It's after 5 pm")
  21. if (hr == 18) document.write("It's after 6 pm, eat some dinner!")
  22. if (hr == 19) document.write("It's after 7 pm")
  23. if (hr == 20) document.write("It's after 8 pm")
  24. if (hr == 21) document.write("It's after 9 pm")
  25. if (hr == 22) document.write("It's after 10 pm")
  26. if (hr == 23) document.write("It's after 11 pm, go to bed!")
  27. if (hr == 0) document.write("It's after midnight.")
  28. document.write("</font></div>")

Sin conocer css.
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.