Javascript diaporama pb
Résolu
sebou66
Messages postés
51
Statut
Membre
-
emre77130t -
emre77130t -
J'ai récupérer ce script sur le net, puis je l'ai modifié pour qu'il aille avec mes attentes, au départ il n'afficher qu'une photo et deux liens précédent et suivant. Je les ai remplacé par des photos 2 pour suivant et 2 pour précédent pour que la navigation soit plus sympas, le problème est que je n'arrive pas à mettre la plus grande image au centre et les 2 precedent a gauche et les autres à droite.
Voici mon script si quelqu'un pourrait m'aider merci d'avance.
<DIV ID=ejs_photo_box></div>
<script type="text/javascript">
ejs_photo = new Array;
<?php
$a = 0;
$handle = opendir("photos");
while (($file = readdir())!=false) {
clearstatcache();
if($file!=".." && $file!=".")
{
echo "ejs_photo[$a] = 'photos/$file';";
$a++;
}
}
closedir($handle);
?>
function ejs_aff_photos(num)
{
if(document.getElementById)
{
ejs_fin = "";
if((num-1)>0)
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num-2)+");return(false)'><IMG SRC='"+ejs_photo[num-2]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; //la premiere photo prédent
if(num!=0)
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num-1)+");return(false)'><IMG SRC='"+ejs_photo[num-1]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; // la deuxième précédent
if(num<(ejs_photo.length-2))
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num+1)+");return(false)'><IMG SRC='"+ejs_photo[num+1]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; // la première photo suivant
if(num<(ejs_photo.length-3))
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num+2)+");return(false)'><IMG SRC='"+ejs_photo[num+2]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; //la deuième photo suivant
document.getElementById("ejs_photo_box").innerHTML = "<CENTER><IMG SRC='"+ejs_photo[num]+"' BORDER=0 style=margin:15px width=200 height=200><br>"+ejs_fin+"</CENTER>"; // La photo à centrer
}
}
window.onload = new Function("ejs_aff_photos(0)")
</script>
Voici mon script si quelqu'un pourrait m'aider merci d'avance.
<DIV ID=ejs_photo_box></div>
<script type="text/javascript">
ejs_photo = new Array;
<?php
$a = 0;
$handle = opendir("photos");
while (($file = readdir())!=false) {
clearstatcache();
if($file!=".." && $file!=".")
{
echo "ejs_photo[$a] = 'photos/$file';";
$a++;
}
}
closedir($handle);
?>
function ejs_aff_photos(num)
{
if(document.getElementById)
{
ejs_fin = "";
if((num-1)>0)
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num-2)+");return(false)'><IMG SRC='"+ejs_photo[num-2]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; //la premiere photo prédent
if(num!=0)
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num-1)+");return(false)'><IMG SRC='"+ejs_photo[num-1]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; // la deuxième précédent
if(num<(ejs_photo.length-2))
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num+1)+");return(false)'><IMG SRC='"+ejs_photo[num+1]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; // la première photo suivant
if(num<(ejs_photo.length-3))
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num+2)+");return(false)'><IMG SRC='"+ejs_photo[num+2]+"' BORDER=0 style=margin:5px width=50 height=50></A>"; //la deuième photo suivant
document.getElementById("ejs_photo_box").innerHTML = "<CENTER><IMG SRC='"+ejs_photo[num]+"' BORDER=0 style=margin:15px width=200 height=200><br>"+ejs_fin+"</CENTER>"; // La photo à centrer
}
}
window.onload = new Function("ejs_aff_photos(0)")
</script>
A voir également:
- Javascript diaporama pb
- Faire un diaporama photo avec musique windows 10 - Guide
- Telecharger javascript - Télécharger - Langages
- En préparant son diaporama, tom a pris quelques notes qui l'aideront lors de sa présentation. quand il présentera l'âne, il a prévu de raconter une anecdote sur cet animal. comment s'appelle l'âne de son histoire ? - Forum Windows
- Télécharger diaporama amicalement votre - Forum Logiciels
- Mettre plusieurs musique sur diaporama powerpoint - Forum Powerpoint
5 réponses
je te conseille un logicielle de diapo tajoute des foto tu choisi ton theme diapo et voila c fait photo flash maker free
merci c'est exactement ce que je voulais c'est beaucoup plus simple et fluide aussi, merci pour tes réponses
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question