Ver Mensaje Individual
  #8 (permalink)  
Antiguo 03/07/2012, 10:40
Avatar de paxarin
paxarin
 
Fecha de Ingreso: enero-2010
Ubicación: Santander
Mensajes: 413
Antigüedad: 14 años, 3 meses
Puntos: 6
Respuesta: Cambiar imagen y css dependiendo de la hora

Cita:
Iniciado por emprear Ver Mensaje
Esto ya lo contesté un par de veces, pero no recuerdo dónde, asi que lo pongo otra vez

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="estilos1.css" media="screen" id="hojadeestilos" />
  7. <script type="text/javascript">
  8. //<![CDATA[
  9. function banner() {
  10. var hoy = new Date();
  11. var hora = hoy.getHours();
  12. var banner_logo = document.getElementById('banner');
  13. if((hora >= 7)&&(hora <= 14)) { // 7,8,9,10,11,12,13,14
  14. banner_logo.src = 'sfondo03.jpg';
  15. document.getElementById('hojadeestilos').href='estilos1.css';
  16. }
  17. if((hora >= 15)&&(hora <= 22)) { // 15,16,17,18,19,20,21,22
  18. banner_logo.src = 'sfondo07.jpg';
  19. document.getElementById('hojadeestilos').href='estilos2.css';
  20. }
  21. if((hora >= 23)||(hora < 7)){ // 23,0,1,2,3,4,5,6
  22. banner_logo.src = 'sfondo06.jpg';
  23. document.getElementById('hojadeestilos').href='estilos3.css';
  24. }
  25. }
  26. //]]>
  27. </head>
  28. <body onload="banner();">
  29. <h1>Demo</h1>
  30. <img src="sfondo03.jpg" id="banner" alt="" />  
  31. </body>
  32. </html>


Este ejemplo hace una rotación cada 8 horas.
Tendrás que adaptarla a tu necesidad
Saludos
Gracias por el post, probare haber cual puede ser el problema.
Un saludo y muchas gracias
__________________
http://www.paxarindesign.es