[RESOLU] Ca ne défile pas ?

Petit nouveau ! | 6 Messages

13 mai 2013, 12:15

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>

Mammouth du PHP | 619 Messages

13 mai 2013, 16:41

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 :)

Petit nouveau ! | 6 Messages

13 mai 2013, 17:59

J'ai essayer et maintenant il me donne une erreur de script

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

Mammouth du PHP | 619 Messages

13 mai 2013, 18:47

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>

 
Modifié en dernier par ghost5922 le 13 mai 2013, 21:18, modifié 1 fois.

Petit nouveau ! | 6 Messages

13 mai 2013, 19:49

Oki :D :D :D

Maintenant ça marche

Merci beaucoup