Page 1 sur 1

Ca ne défile pas ?

Posté : 13 mai 2013, 12:15
par udolfo
Bonjour,

je me suis basé sur un script existant pour faire un diaporama défilant....mais ça ne défile pas, il reste fixe sur la première image
et comme je n'en touche pas une en Java si quelqu'un peut me dire pourquoi se serait sympa

Merci

Ah oui voici le script

<img name="ChangingPix" src="Oasis3.jpg" width="1900" height="1262">
<SCRIPT LANGUAGE="JavaScript">
<!--
var timeDelay = 5;
var Pix = new Array
("Oasis3r.jpg","Oasis-T2-new.jpg","Oasis-T3.jpg","les-villas-oasis-new.jpg");
var howMany = Pix.length;
timeDelay *= 1000;
var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = Pix[PicCurrentNum];
function startPix() {
setInterval("slideshow()", timeDelay);
}
function slideshow() {
PicCurrentNum++;
if (PicCurrentNum == howMany) {
PicCurrentNum = 0;
}
PicCurrent.src = Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
}
//  End -->
</script>

Re: Ca ne défile pas ?

Posté : 13 mai 2013, 16:41
par ghost5922
Bonjour,

teste ceci
<img name="ChangingPix" src="Oasis3.jpg" width="1900" height="1262">
<SCRIPT LANGUAGE="JavaScript">
<!--
var timeDelay = 5;
var Pix = new Array
("Oasis3r.jpg","Oasis-T2-new.jpg","Oasis-T3.jpg","les-villas-oasis-new.jpg");
var howMany = Pix.length;
timeDelay *= 1000;
var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = Pix[PicCurrentNum];
function startPix() {
setInterval("slideshow()", timeDelay);
}
function slideshow() {
PicCurrentNum++;
if (PicCurrentNum == howMany) {
PicCurrentNum = 0;
}
PicCurrent.src = Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
}
//  End -->
startPix();
</script>

tu ne lancés pas la fonction pour la premier fois :)

Re: Ca ne défile pas ?

Posté : 13 mai 2013, 17:59
par udolfo
J'ai essayer et maintenant il me donne une erreur de script

Ligne : 40
caractere : 1
erreur : erreur de syntaxe
code : 0

Re: Ca ne défile pas ?

Posté : 13 mai 2013, 18:47
par ghost5922
Bonjour,

le code fonction voici
<img name="ChangingPix" src="Oasis3r.jpg" width="200" height="262">
<SCRIPT LANGUAGE="JavaScript">
<!--
var timeDelay = 5;
var Pix = new Array
("Oasis3r.jpg","Oasis-T2-new.jpg","Oasis-T3.jpg");
var howMany = Pix.length;
timeDelay *= 1000;
var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = Pix[PicCurrentNum];
function startPix() {
setInterval("slideshow()", timeDelay);
}
function slideshow() {
PicCurrentNum++;
if (PicCurrentNum == howMany) {
PicCurrentNum = 0;
}
PicCurrent.src = Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
}
//  End -->
startPix();
</script>

 

Re: Ca ne défile pas ?

Posté : 13 mai 2013, 19:49
par udolfo
Oki :D :D :D

Maintenant ça marche

Merci beaucoup