Foros del Web » Programación para mayores de 30 ;) » Java »

Crear imágenes aleatorias con sus respectivos textos

Estas en el tema de Crear imágenes aleatorias con sus respectivos textos en el foro de Java en Foros del Web. Hola, Tengo almacenadas 24 fotografías en Photobucket.com y necesito que, en una entrada de mi blog, aparezca sólo una fotografía, pero que ésta cambie cada ...
  #1 (permalink)  
Antiguo 27/01/2012, 02:36
 
Fecha de Ingreso: enero-2012
Mensajes: 3
Antigüedad: 12 años, 2 meses
Puntos: 0
Pregunta Crear imágenes aleatorias con sus respectivos textos

Hola,
Tengo almacenadas 24 fotografías en Photobucket.com y necesito que, en una entrada de mi blog, aparezca sólo una fotografía, pero que ésta cambie cada vez que se refresque o renueve (F5) la página. Pero, a su vez, que debajo de la fotografía, aparezca un texto asociado sólo a ella. (imagen aleatoria con su respectivo texto aleatorio)
Es decir, que cada vez que se renueve la página de mi blog, aparezca una imagen distinta con su respectivo texto.
Por favor, ayuda !!!!
GRACIAS
  #2 (permalink)  
Antiguo 27/01/2012, 04:39
Avatar de DooBie  
Fecha de Ingreso: septiembre-2004
Mensajes: 1.101
Antigüedad: 19 años, 7 meses
Puntos: 71
Respuesta: Crear imágenes aleatorias con sus respectivos textos

Con la API de photobucket podrás hacerlo: http://photobucket.com/developer
Para lo del texto, lo ideal sería que en la descripción de la foto (dentro de photobucket) pongas lo que quieras relacionado a esa foto, así cuando uses la api, recoges la foto y la descripción.

De nada.
  #3 (permalink)  
Antiguo 27/01/2012, 06:53
 
Fecha de Ingreso: enero-2012
Mensajes: 3
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Crear imágenes aleatorias con sus respectivos textos

Gracias por tu aporte.
Lo más seguro que sirva un montón, pero no entendí nada de cómo hacerlo.
De todas maneras, los textos ya los tenía incorporado en cada fotografía.
Es que hice un javascript y me funciona con las imágenes aleatorias, pero no puedo hacer que aparezca su descripción.
  #4 (permalink)  
Antiguo 27/01/2012, 07:11
 
Fecha de Ingreso: enero-2012
Mensajes: 3
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Crear imágenes aleatorias con sus respectivos textos

Esto fue lo que hice, pero no sé cómo ponerle su descripción correspondiente:


<script type="text/javascript">
var imagenes = new armarvector ("http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/021.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/022.jpg","http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/023.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/024.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/025.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/026.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/027.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/028.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/029.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/030.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/031.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/032.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/033.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/034.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/035.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/036.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/037.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/038.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/039.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/040.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/041.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/042.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/043.jpg", "http://img.photobucket.com/albums/v30/paspito/LECTURA%20DE%20CARTAS%20ANGELICALES/Mensajes%20Angelitos/044.jpg");

function Imagen_Aleatoria() {
hoy= new Date();
maximo=24; //La cantidad de imagenes que poseemos.
segundos=hoy.getSeconds();
if (segundos==0) {segundos=1}
while (segundos>maximo) {segundos=segundos-maximo}
document.write ('<img SRC="'+imagenes[segundos]+'" border=0>');
}

function armarvector (v1, v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v1 6,v17,v18,v19,v20,v21,v22,v23,v24) {
this[1]=v1;
this[2]=v2;
this[3]=v3;
this[4]=v4;
this[5]=v5;
this[6]=v6;
this[7]=v7;
this[8]=v8;
this[9]=v9;
this[10]=v10;
this[11]=v11;
this[12]=v12;
this[13]=v13;
this[14]=v14;
this[15]=v15;
this[16]=v16;
this[17]=v17;
this[18]=v18;
this[19]=v19;
this[20]=v20;
this[21]=v21;
this[22]=v22;
this[23]=v23;
this[24]=v24;
}
</script>


<div align="center">
<script>Imagen_Aleatoria()</script>
</div>
  #5 (permalink)  
Antiguo 27/01/2012, 15:44
Avatar de DooBie  
Fecha de Ingreso: septiembre-2004
Mensajes: 1.101
Antigüedad: 19 años, 7 meses
Puntos: 71
Respuesta: Crear imágenes aleatorias con sus respectivos textos

Supongo que te habrás fijado que este es el foro de Java, no de Javascript

Etiquetas: textos, aleatoria
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:17.