A voir également:
- Besoin d'aide pour un javascript....
- Telecharger javascript - Télécharger - Langages
- Javascript round ✓ - Forum Javascript
- Table de multiplication javascript ✓ - Forum Javascript
- Onclick javascript - Astuces et Solutions
- Afficher un tableau javascript en html ✓ - Forum Javascript
2 réponses
Salut XL
Voici le script modifié (sans erreur j'espère :) )
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
var start=false;
var timeDelay = 3;
var Pix = new Array
("photos/peep1.jpg"
,"photos/peep2.jpg"
,"photos/peep3.jpg"
,"photos/peep4.jpg"
,"photos/peep5.jpg"
,"photos/peep6.jpg"
,"photos/peep7.jpg"
,"photos/peep8.jpg"
);
var howMany = Pix.length;
timeDelay *= 1000;
var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = Pix[PicCurrentNum];
function startPix() {
if (!start)
{
setTimeout("slideshow()", timeDelay);
start=true; // Evite de relancer startPix si l'utilisateur clic pls fois
}
}
function slideshow() {
PicCurrentNum++;
if (PicCurrentNum < howMany) {
PicCurrent.src = Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
if ((PicCurrentNum+1) < howMany) setTimeout("slideshow()", timeDelay);
}
}
// End -->
</script>
</head>
<body bgcolor="#000000" text="#ffffff" link="#000000" vlink="#000000" alink="#000000" onload="startPix()"><br>
<br>
<br>
<center><img name="ChangingPix" src="mon_image_01.jpg" onclick="startPix() "></center>
</body>
</html>
Voilà ca devrait suffire
@+
Philippe
Voici le script modifié (sans erreur j'espère :) )
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
var start=false;
var timeDelay = 3;
var Pix = new Array
("photos/peep1.jpg"
,"photos/peep2.jpg"
,"photos/peep3.jpg"
,"photos/peep4.jpg"
,"photos/peep5.jpg"
,"photos/peep6.jpg"
,"photos/peep7.jpg"
,"photos/peep8.jpg"
);
var howMany = Pix.length;
timeDelay *= 1000;
var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = Pix[PicCurrentNum];
function startPix() {
if (!start)
{
setTimeout("slideshow()", timeDelay);
start=true; // Evite de relancer startPix si l'utilisateur clic pls fois
}
}
function slideshow() {
PicCurrentNum++;
if (PicCurrentNum < howMany) {
PicCurrent.src = Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
if ((PicCurrentNum+1) < howMany) setTimeout("slideshow()", timeDelay);
}
}
// End -->
</script>
</head>
<body bgcolor="#000000" text="#ffffff" link="#000000" vlink="#000000" alink="#000000" onload="startPix()"><br>
<br>
<br>
<center><img name="ChangingPix" src="mon_image_01.jpg" onclick="startPix() "></center>
</body>
</html>
Voilà ca devrait suffire
@+
Philippe