Código:
<html> <head><title>Galeria de Fotos</title> <script language="javascript"> function cambia(d) { cel=document.getElementById("imagen") vector=new array("1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg") { c=c+1 if(c>vector.length) {c=0 cel=img.src="fotos\"+vector[c]; } else { cel=img.src="fotos\"+vector[c]; } } else { c=-1 if(c<vector.length) { c=vector.length cell=img.src="fotos\"+vector[c]; } else { cel=img.src="fotos\"+vector[c]; } } function auto(f) { vector=new array("1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg") cel=document.getElementById("imagen") if(f==1) { c=c+1 a=SetTimeout("auto(f)",1000) if (c>vector.length) { c=0 cel.src="fotos\"+vector[c]; } else {cel.src="fotos\"+vector+[c]; } } else {clearinterval(a); } } </script> </head> <body> <center><h1>Galeria de Imagenes</h1></center> <form name=Galeria> <table border="1" align="center"> <td colspan="3" align="center"><img src="fotos\1.jpg" id="imagen" width"80" height="132"></td> <tr> <td><input type="button" name="cmdvolver" value="<" onClick="cambiar(0)"></td> <td><input type="button" name="cmdauto" value="auto" onClick="auto(1)"></td> <td><input type="button" name="cmdsiguiente" value=">" onClick="cambiar(1)"></td> </tr> <tr align="center"colspan="3"><input type="button" name="cmdstop" value="stop" onClik="auto(0)"></tr> </table> </form> </body> </html>