Jai un problème sur un diaporama. Jai crée un script qui permet dafficher des vignettes et une image ... Le problème est le suivant, quand jutilise la fonction me permettant dafficher des vignettes ca marche et quand jutilise la fonction me permettant dafficher limage ca marche aussi ...
Mais quand jutilise les deux fonctions, lune aprés lautre ... ca marche plus ...
Marsh Posté le 30-08-2005 à 23:46:10
Bonjour,
Jai un problème sur un diaporama. Jai crée un script qui permet dafficher des vignettes et une image ... Le problème est le suivant, quand jutilise la fonction me permettant dafficher des vignettes ca marche et quand jutilise la fonction me permettant dafficher limage ca marche aussi ...
Mais quand jutilise les deux fonctions, lune aprés lautre ... ca marche plus ...
Je mets la source javascript ... et le lien de ma page web http://perso.wanadoo.fr/phildenis4 [...] hotos.html
//Déclaration du constructeur SlideShow
function SlideShow(NbrPics,Pays)
{
this.NbrPics = NbrPics;
this.NbrSheet = 0;
this.Index = 0;
this.Pays = Pays;
}
//Fonction de Gestion du diaporama
SlideShow.prototype.Manage = function()
{
//Chargement des Vignettes. + 1er Image.
this.PreLoadVign();
this.LoadPic();
}
//Fonction permettant de charger une image
SlideShow.prototype.LoadPic = function()
{
//Test sur l'Index
if (this.Index >0)
document.getElementById("Image" ).src = "Photos/Photos" + this.Index + ".jpg";
}
//Fonction permettant de charger les 10 premieres vignettes
SlideShow.prototype.PreLoadVign = function()
{
//Declaration d'une variable.
var Nbr = 10;
//Verif. sur le Nbr d'image.
if (this.NbrPics > 10)
Nbr = this.NbrPics;
//Boucle d'affichage
for (Indx =1; Indx <= Nbr; Indx++)
document.getElementById("Vignette" + Indx).src = "Photos/Photos" + Indx + "_150.jpg";
//Init. Index
if (this.NbrPics > 0)
this.Index = 1;
}