Foros del Web » Programando para Internet » Javascript »

Error en javascript

Estas en el tema de Error en javascript en el foro de Javascript en Foros del Web. Hola tengo el siguiente codigo de javascript : Lo que tiene que hacer es ir pasando las imagenes cada cierto tiempo solas pero no lo ...
  #1 (permalink)  
Antiguo 13/03/2010, 07:02
 
Fecha de Ingreso: marzo-2010
Mensajes: 4
Antigüedad: 14 años, 1 mes
Puntos: 0
Error en javascript

Hola tengo el siguiente codigo de javascript:

Lo que tiene que hacer es ir pasando las imagenes cada cierto tiempo solas pero no lo hace, se queda una imagen fija. Alguno sabe que hago mal?

En la cabecera:

Cita:
<script language="JavaScript1.1">

<!--

var slideimages=new Array()

var slidelinks=new Array()

function slideshowimages(){

for (i=0;i<slideshowimages.arguments.length;i++){

slideimages=new Image()

slideimages.src=slideshowimages.arguments

}

}



function slideshowlinks(){

for (i=0;i<slideshowlinks.arguments.length;i++)

slidelinks=slideshowlinks.arguments

}



function gotoshow(){

if (!window.winslide||winslide.closed)

winslide=window.open(slidelinks[whichlink])

else

winslide.location=slidelinks[whichlink]

winslide.focus()

}



//-->

</script>

En el cuerpo:

Cita:
<table width="142" height="184" border="0" background="imagenes/fondo_menu.png">
<tr>
<td ><div>
<a href="javascript:gotoshow()"><img width="135" height="179" src="imagenes/obras/obra1/DSC00042.JPG" name="slide" border=0></a>

<script>

<!--

//configure the paths of the images, plus corresponding target links

slideshowimages("imagenes/obras/obra1/DSC00043.JPG","imagenes/obras/obra1/DSC00044.JPG","imagenes/obras/obra1/DSC00045.JPG")

slideshowlinks("curso.html","curso.html","curso.ht ml")
//configure the speed of the slideshow, in miliseconds
var slideshowspeed=200

var whichlink=0

var whichimage=0

function slideit(){

if (!document.images)

return

document.images.slide.src=slideimages[whichimage].src

whichlink=whichimage

if (whichimage<slideimages.length-1)

whichimage++

else

whichimage=0

setTimeout("slideit()",slideshowspeed)

}

slideit()



//-->

</script>
</div> </td>
</tr>
</table>
Miro en la consola de errores de firefox y me dice esto:

Cita:
Error: slideimages[whichimage] is undefined
Archivo de origen: file:///J:/Webs/Excavaciones%20Hermanos%20de%20Pablo/Ejemplo%203/index.html
Línea: 193
Como puedo solucionarlo?

Etiquetas: Ninguno
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 10:33.