Diaporama

Diaporama - HTML/CSS - Programmation

Marsh Posté le 30-08-2005 à 23:46:10    

Bonjour,
 
J’ai un problème sur un diaporama. J’ai crée un script qui permet d’afficher des vignettes et une image ... Le problème est le suivant, quand j’utilise la fonction me permettant d’afficher des vignettes ca marche et quand j’utilise la fonction me permettant d’afficher l’image ca marche aussi ...
 
Mais quand j’utilise les deux fonctions, l’une aprés l’autre ... 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;
}

Reply

Marsh Posté le 30-08-2005 à 23:46:10   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed