bonjour,
connaissez vous un script ou un tuto qui me permet de réaliser une visionneuse d image automatique ( du genre de celle de hotmail)?
merci beaucoup
Code : Tout sélectionner
<html>
<body>
<script language=javascript>
var bauto = 0;
var dossier="";
var numero = 1;
function objet() {
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
[b]var nom = new objet ("imaga.gif", "imagb.gif", "imagc.gif");[/b]
function suivante() {
numero += 1;
if (numero == nom.length + 1) numero = 1;
document.image.src = dossier+nom[numero];
}
function precedente() {
numero -= 1;
if (numero == 0) numero = nom.length;
document.image.src = dossier+nom[numero];
}
function changer() {
numero += 1;
if (numero == nom.length + 1) numero = 1;
document.image.src = dossier+nom[numero];
roll=setTimeout("changer()", 1500);
}
function initial() {
window.clearTimeout(roll);
document.image.src = dossier+nom[numero];
}
function auto() {
if (bauto == 0) {
bauto =1; changer();
document.vision.automat.value=" Lect/Stop ";
}
else {
bauto =0; initial();
document.vision.automat.value=" Lect/Auto ";
}
}
</script>
<form name="vision">
<div align="center">
<input type="button" name="precedent" value="Précédente" onClick="precedente();">
<input type="button" name="suivant" value=" Suivante " onClick="suivante();">
<input type="button" name="automat" value=" Lect/Auto "onClick="auto();">
</div>
</form>
<div align="center"> <img src="imaga.gif" width="200" height="194" name="image"></div>
</body>
</html>