Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/01/2006, 04:47
chectopow
 
Fecha de Ingreso: enero-2006
Mensajes: 1
Antigüedad: 18 años, 3 meses
Puntos: 0
Ayuda Con este script de IMAGENES

El problema que tengo esque no me funciona bien el script, el boton de alante funciona perfectamente, y el hipervinculo vuevle a empezar tambien, el problema es con el boton atras que debe tener algun problema la funcion atras, seguro que es una chorrada, bueno gracia de antemano.

<img src="imagenes/fotos/Castellnovo/1G.jpg" width="606" height="536" name="intro">

<form name="galleria">

<script language="JavaScript1.1">

var photos=new Array()
var which=0

photos[0]="imagenes/fotos/Castellnovo/1G.jpg"
photos[1]="imagenes/fotos/Castellnovo/2G.jpg"
photos[2]="imagenes/fotos/Castellnovo/3G.jpg"
photos[3]="imagenes/fotos/Castellnovo/4G.jpg"
photos[4]="imagenes/fotos/Castellnovo/5G.jpg"
photos[5]="imagenes/fotos/Castellnovo/6G.jpg"
photos[6]="imagenes/fotos/Castellnovo/7G.jpg"
photos[7]="imagenes/fotos/Castellnovo/8G.jpg"
photos[8]="imagenes/fotos/Castellnovo/9G.jpg"
photos[9]="imagenes/fotos/Castellnovo/10G.jpg"
photos[10]="imagenes/fotos/Castellnovo/11G.jpg"
photos[11]="imagenes/fotos/Castellnovo/12G.jpg"
function retroceso(){
if (which>0){
window.status='Primera imagen'
which--
document.images.intro.src=photos[which]
}
}
function adelante(){
if (which<photos.length-1){
which++
document.images.intro.src=photos[which]
}
else window.status='Fin de las imágenes'
}
function atras(){
if (which>photos.length-1){
which++
document.images.intro.src=photos[which]
}
else window.status='Fin de las imágenes'
}
</script>

<input type="button" value="&lt;&lt;atrás" name="B2" onClick="atras()">
<input type="button" value="adelante&gt;&gt;" name="B1" onClick="adelante()">

<br>

<a href="#" onClick="which=1;retroceso();return false">Vuelve a empezar</a>

</form>