Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript
JavaScript Forum programmation JavaScript. Lire : Cours JavaScript, FAQ JavaScript, Toutes les FAQ JavaScript et Sources JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 21/06/2011, 20h36   #1
Invité de passage
 
Homme
Technicien maintenance
Inscription : juin 2011
Messages : 2
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Hauts de Seine (Île de France)

Informations professionnelles :
Activité : Technicien maintenance
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : juin 2011
Messages : 2
Points : 0
Points : 0
Par défaut ma visionneuse d'images

Bonsoir, je suis un débutant et j'ai un soucis avec ma visionneuse d'image, voici le script, les boutons s'affichent bien, l'encadrement est ok, les noms sont s'affichent aussi, mais je n'ai aucune images qui s'affichent !!! Pourriez vous m'aider à résoudre ce problème........par avance merci à tous...voici le script:
Code html :
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html>
	<head><title> J'aimerai que cela marche</title>
 
	<SCRIPT LANGUAGE="JavaScript">
	var rotate_delay = 2000;
	current = 0;
	function next() {
	if (document.slideform.slide[current+1]) {
	document.images.show.src = document.slideform.slide[current+1].value;
	document.slideform.slide.selectedIndex = ++current;
	   }
	else first();
	}
	function previous() {
	if (current-1 >= 0) {
	document.images.show.src = document.slideform.slide[current-1].value;
	document.slideform.slide.selectedIndex = --current;
	   }
	else last();
	}
	function first() {
	current = 0;
	document.images.show.src = document.slideform.slide[0].value;
	document.slideform.slide.selectedIndex = 0;
	}
	function last() {
	current = document.slideform.slide.length-1;
	document.images.show.src = document.slideform.slide[current].value;
	document.slideform.slide.selectedIndex = current;
	}
	function ap(text) {
	document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
	rotate();
	}
	function change() {
	current = document.slideform.slide.selectedIndex;
	document.images.show.src = document.slideform.slide[current].value;
	}
	function rotate() {
	if (document.slideform.slidebutton.value == "Stop") {
	current = (current == document.slideform.slide.length-1) ? 0 : current+1;
	document.images.show.src = document.slideform.slide[current].value;
	document.slideform.slide.selectedIndex = current;
	window.setTimeout("rotate()", rotate_delay);
	   }
	}
	//  End -->
	</script>
 
 
 
 
	</head>
 
 
	<body>
 
	<center>
	<form name=slideform>
	<table cellspacing=1 cellpadding=4 bgcolor="#000000">
	<tr>
	<td align=center bgcolor="white">
	<b>Nature sauvage</b>
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="white" width=500 height=350>
	<img src="nature1.jpg" name="show">
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="#C0C0C0">
	<select name="slide" onChange="change();">
	<option value="nature1.jpg" selected>un arbre
	<option value="nature2.jpg">une baleine
	<option value="nature3.jpg">une rivière
	<option value="nature4.jpg">une tortue de mer
	</select>
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="#C0C0C0">
	<input type=button onClick="first();" value="|<<" title="Beginning">
	<input type=button onClick="previous();" value="<<" title="Previous">
	<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
	<input type=button onClick="next();" value=">>" title="Next">
	<input type=button onClick="last();" value=">>|" title="End">
	</td>
	</tr>
	</table>
	</form>
	</center>
 
	</body>
 
	</html>
stef92 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/06/2011, 20h42   #2
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 943
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 943
Points : 4 770
Points : 4 770
Bonsoir,
à première vu, difficile d'ailleurs, je dirais un problème de chemin d'accès.

IMPORTANT
Mets les balises [code] grâce au bouton # de l'éditeur
NoSmoking est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/06/2011, 16h57   #3
Invité de passage
 
Homme
Technicien maintenance
Inscription : juin 2011
Messages : 2
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Hauts de Seine (Île de France)

Informations professionnelles :
Activité : Technicien maintenance
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : juin 2011
Messages : 2
Points : 0
Points : 0
Par défaut ma visionneuse d'image

Je ne comprend pas, le tableau s'affiche bien avec les boutons suivant, précédent, start et stop, mais les images ne s'affichent pas.
Voici le script dans son intégralité:
Code html :
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html>
	<head><title> J'aimerai que cela marche</title>
 
	<SCRIPT type="text/JavaScript">
	var rotate_delay = 2000;
	current = 0;
	function next() {
	if (document.slideform.slide[current+1]) {
	document.images.show.src = document.slideform.slide[current+1].value;
	document.slideform.slide.selectedIndex = ++current;
	   }
	else first();
	}
	function previous() {
	if (current-1 >= 0) {
	document.images.show.src = document.slideform.slide[current-1].value;
	document.slideform.slide.selectedIndex = --current;
	   }
	else last();
	}
	function first() {
	current = 0;
	document.images.show.src = document.slideform.slide[0].value;
	document.slideform.slide.selectedIndex = 0;
	}
	function last() {
	current = document.slideform.slide.length-1;
	document.images.show.src = document.slideform.slide[current].value;
	document.slideform.slide.selectedIndex = current;
	}
	function ap(text) {
	document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
	rotate();
	}
	function change() {
	current = document.slideform.slide.selectedIndex;
	document.images.show.src = document.slideform.slide[current].value;
	}
	function rotate() {
	if (document.slideform.slidebutton.value == "Stop") {
	current = (current == document.slideform.slide.length-1) ? 0 : current+1;
	document.images.show.src = document.slideform.slide[current].value;
	document.slideform.slide.selectedIndex = current;
	window.setTimeout("rotate()", rotate_delay);
	   }
	}
	//  End -->
	</script>
 
 
 
 
	</head>
 
 
	<body>
 
	<center>
	<form name=slideform>
	<table cellspacing=1 cellpadding=4 bgcolor="#000000">
	<tr>
	<td align=center bgcolor="white">
	<b>Nature sauvage</b>
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="white" width=500 height=350>
	<img src="nature1.jpg" name="show">
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="#C0C0C0">
	<select name="slide" onChange="change();">
	<option value="nature1.jpg" selected>un arbre
	<option value="nature2.jpg">une baleine
	<option value="nature3.jpg">une rivière
	<option value="nature4.jpg">une tortue de mer
	</select>
	</td>
	</tr>
	<tr>
	<td align=center bgcolor="#C0C0C0">
	<input type=button onClick="first();" value="|<<" title="Beginning">
	<input type=button onClick="previous();" value="<<" title="Previous">
	<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
	<input type=button onClick="next();" value=">>" title="Next">
	<input type=button onClick="last();" value=">>|" title="End">
	</td>
	</tr>
	</table>
	</form>
	</center>
 
	</body>
 
	</html>

Merci pour votre aide.
stef92 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/06/2011, 18h56   #4
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 943
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 943
Points : 4 770
Points : 4 770
la question qui ce pose, visiblement, est est ce que l'image s'affiche au départ, je parle de celle ci
Code :
1
2
3
<td align=center bgcolor="white" width=500 height=350>
<img src="nature1.jpg" name="show">
</td>
si non c'est que le chemin de l'image n'est pas complet.

La façon de renseigner la src de la balise IMG sous entend que les images sont dans le même répertoire que ton fichier HTML.

on pourrait en profiter pour ajouter que le nom des images ne me parait pas judicieux
Code :
1
2
3
4
5
6
<select name="slide" onChange="change();">
<option value="nature1.jpg" selected>un arbre
<option value="nature2.jpg">une baleine
<option value="nature3.jpg">une rivière
<option value="nature4.jpg">une tortue de mer
</select>
...mais c'est du détail...
NoSmoking est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h01.


 
 
 
 
Partenaires

Hébergement Web