Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/11/2012, 20:06
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Animación (secuencia de imagenes)

Seguimos en la misma. esto como se entiende
Cita:
Yo conzco de antemano como será el url y la hora que sale, pero no se a la hora que sale realmente
vos lo que necesitás son los nombres de los archivos, a no ser que me digas que efectivamente los nombres sean,
1830
1900
1930
2000
2030

pero puede que salgan en estas horas
1835
1920
1945
2002
2038

por otro lado, con que frecuencia salen las imágenes, 1 minuto, 10, 20, etc

Bueno, muchas dudas, de todas formas te dejo esto como tentativa
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.  
  7. <script type="text/javascript">
  8. //<![CDATA[
  9. var ImagenPrueba = new Image();
  10. var fondos = ['castilla.png', 'castilla.jpg', 'castilla.gif'];
  11. var fondo_actual = 0;
  12.  
  13. var CambiarFondo = function(){
  14. if (fondo_actual == fondos.length) {
  15. fondo_actual = 0;
  16. }
  17. var precargar =fondo_actual++;
  18.  
  19. ImagenPrueba.src = fondos[precargar];
  20. ImagenPrueba.onload = function(){
  21. document.getElementById('capa').style.backgroundImage = "url("+this.src+")";
  22. document.getElementById('capa').innerHTML = "";
  23. }
  24. ImagenPrueba.onerror = function(){
  25. document.getElementById('capa').style.backgroundImage = "none";
  26. document.getElementById('capa').innerHTML = "Imagen "+ fondos[precargar] + "  no disponible";
  27. }
  28.  
  29. }
  30.  
  31. window.setInterval(CambiarFondo, 5000);
  32. //]]>
  33. </head>
  34. <div style="width: 134px;height:124px;" id="capa">
  35.     Próxima toma en 5 segundos
  36. </div>
  37. </body>
  38. </html>


Para la demo, de las tres imágenes en el array hacé que solo una exista., se pueden hacer variantes.
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.