Foros del Web » Programando para Internet » Javascript »

Problema cambio de imagenes

Estas en el tema de Problema cambio de imagenes en el foro de Javascript en Foros del Web. Buenos días, Tengo un código para que haga un SlideShow de imágenes y texto(los textos van relacionados con las imagenes, y por lo tanto cambian ...
  #1 (permalink)  
Antiguo 27/10/2008, 03:31
 
Fecha de Ingreso: febrero-2007
Mensajes: 37
Antigüedad: 17 años, 2 meses
Puntos: 0
Sonrisa Problema cambio de imagenes

Buenos días,
Tengo un código para que haga un SlideShow de imágenes y texto(los textos van relacionados con las imagenes, y por lo tanto cambian a la vez) y en el Explorer me funciona perfectamente mi problema es que por ejemplo en el Opera no me funciona, no me muestra ni siquiera la primera imagen ni el primer texto.
El código es el siguiente:

<SCRIPT LANGUAGE="JavaScript">
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 5000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var aPicture = new Array();
aPicture[0] = ["images/image1_big.jpg","texto 1<br>Este texto es de prueba.","http://www.enlace1.com"];
aPicture[1] = ["images/image3_big.jpg","texto 2","http://www.enlace2.com"];
aPicture[2] = ["images/image4_big.jpg","texto 3","http://www.enlace3.com"];

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = aPicture.length-1;

var preLoad = new Array();
for (iss = 0; iss < aPicture.length; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = aPicture[iss][0];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTran s(duration=2)";
document.images.PictureBox.style.filter="blendTran s(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Appl y();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= "<a href=\"" + aPicture[jss][2] + "\">" + aPicture[jss][1] + "</a>";
if (document.all) document.images.PictureBox.filters.blendTrans.Play ();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}
</script>
<BODY onLoad="runSlideShow()">

<table cellpadding="0" cellspacing="0">
<tr>
<!--
The next table cell holds the images.
Set cell and image width and height the same.
The img src must have name=PictureBox in its
tag. Usually the first image in the Picture
array in the script is used here.
//-->
<td width=175 height=210>
<img src=imagenes/defaultcaption.gif name=PictureBox width=175 height=210></td>
<td width="30px">&nbsp;</td>
<!--
The next table cell holds the captions.
This table cell must have id=CaptionBox and
class=Caption in its tag. The default caption
shows whilst loading in all browsers; NS4
will show only the default caption, throughout.
//-->
<td id=CaptionBox class=Caption align=center>
&nbsp;<br>&nbsp;
</td>
</tr>
</table>

</body>

Espero que alguien me pueda ayudar.

Muchísimas gracias
  #2 (permalink)  
Antiguo 27/10/2008, 04:17
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Respuesta: Problema cambio de imagenes

Hola:

Es que el código está hecho para explorer... si bien opera acepta la colección "document.all", el uso de filtros es exclusivo de ms, así que te recomiendo que búsques códigos que funcionen en todos los navegadores...

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #3 (permalink)  
Antiguo 27/10/2008, 04:40
 
Fecha de Ingreso: febrero-2007
Mensajes: 37
Antigüedad: 17 años, 2 meses
Puntos: 0
Respuesta: Problema cambio de imagenes

Pero este código me funciona (más o menos, ya que me cambia las imágenes y los textos pero no hace el mismo estilo al cambiarlas) también en el chrome y en el mozilla.

Bueno, pues si este código no de puede arreglar para que se vea en todos los navegadores, alguien me podría decir alguno?

Muchas gracias
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 08:29.