Bonjour!!
j'aimerai réaliser une visionneuse
Voici le code que j'utilise.
La premiere image s'affiche mais pas les deux autres.
Voyez vous mon erreur?
Merci d'avance

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 <html>
 <head>
<script language="JavaScript">
<!--
 
var bauto = 0;
var numero = 1;
var dossier="C:\Documents and Settings\Mes documents\Mes images\photos_site\PICTURES\";
 
function objet()
{
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
 
var nom = new objet ("imaga.jpg", "imagb.jpg", "imagc.jpg");
 
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>
</head>
 
<body>
<form name="vision">
<div align="center">
<input type="button" name="precedent" value="Précédente" onClick="precedente();">
&nbsp;&nbsp;&nbsp;
<input type="button" name="suivant" value=" Suivante " onClick="suivante();">
&nbsp;&nbsp;&nbsp;
<input type="button" name="automat" value=" Lect/Auto "onClick="auto();">
</div>
</form>
<div align="center">&nbsp;<img src="C:\Documents and Settings\Mes documents\Mes images\photos_site\PICTURES\imaga.jpg" width="300" height="200" name="image"></div>
 </body>
</html>