Hola a todos. El siguiente Javascript Cambia imagenes cada 5 segundos:
<html>
<head>
<title>Cambia de imagen cada 5 segundos</title>
<script language="JavaScript">
<!-- hide from other browsers
//Pictures to switch inbetween
var Rollpic1 = "imagen1.jpg";
var Rollpic2 = "imagen2.jpg";
var Rollpic3 = "imagen3.jpg";
//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberOfPictures=3;
//Time between pics switching in secs
var HowLongBetweenPic=5;
//SwitchPic Function
function SwitchPic(counter){
if(counter < HowLongBetweenPic){
counter++;
//DEBUG in the status bar at the bottom of the screen
window.status="Cambia imagen cada 5 segundos : "+counter+" - Imagen nº: "+PicNumber+" ";
//Display pic in what <IMG> tag roll is what I called the image
document.roll.src = eval("Rollpic" + PicNumber);
//function calls itself
CallSwitchPic=window.setTimeout("SwitchPic("+count er+")",1500);
}
else{
//if its not the last picture goto the next picture
if(PicNumber < NumberOfPictures){
PicNumber++;
SwitchPic(0);
}
//its the last picture go to the first one
else{
PicNumber=1;
SwitchPic(0);
}
}
}
// Stop hiding from old browsers -->
</script>
</head>
<body onload="SwitchPic(0)">
<p align="center"><b>Cambia de imagen cada 5 segundos<br>
</b>
<br>
<img src="imagen1.jpg" border="0" name="roll" width="200" height="150"> </p>
<p align="center"><font size="2">Imágenes:<br>
<a href="imagen1.jpg">imagen1.jpg</a> <a href="imagen2.jpg">imagen2.jpg</a>
<a href="imagen3.jpg">imagen3.jpg</a></font></p>
</body>
</html>
¿¿¿¿COMO SERIA SI EN VEZ DE IMAGENES FUERAN DOCUMENTOS .HTM ???