Un diaporama reste sur la même image

Résolu/Fermé
will.smith Messages postés 256 Date d'inscription jeudi 18 septembre 2008 Statut Membre Dernière intervention 27 mars 2010 - 12 oct. 2008 à 13:57
will.smith Messages postés 256 Date d'inscription jeudi 18 septembre 2008 Statut Membre Dernière intervention 27 mars 2010 - 13 oct. 2008 à 00:19
Bonjour,

j'ai fais un diaporama avec des chiffres

http://forum.exemple.free.fr/ton_diaporama.php

mais si on clique sur 1 2 3 la photo ne veut pas changer

voilà le code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<html> 
<head> 
<title>Exemple diaporama</title> 
</head> 

<body> 
<DIV ID="ejs_photo_box"></div> 
<SCRIPT LANGUAGE=JavaScript> 
ejs_photo = new Array; 
ejs_photo[0] = '1.jpg'; 
ejs_photo[1] = '2.jpg'; 
ejs_photo[2] = '3.jpg'; 
ejs_photo[3] = '4.jpg'; 

function ejs_aff_photos(num) 
{ 
var ejs_fin="<br />"; 
if(document.getElementById("ejs_photo_box")) 
{ 
for(var i=0; i<ejs_photo.length; i++) 
ejs_fin += "<a href='#' onClick='ejs_aff_photos(i+1)'>"+i+" </a>"; 
document.getElementById("ejs_photo_box").innerHTML = "<CENTER><IMG SRC='"+ejs_photo[num]+"' BORDER='0'><br />"+ejs_fin+"</CENTER>"; 
} 
} 
window.onload = new Function("ejs_aff_photos(0)") 


</script> 

</body>
</html>




et j'ai éssayé de faire commencé 1 au lieu par 0 mais l'image s'est planté il n'a plus d'image

si quelqu'un pourrais m'aidé ca seras trés sympas
A voir également:

1 réponse

will.smith Messages postés 256 Date d'inscription jeudi 18 septembre 2008 Statut Membre Dernière intervention 27 mars 2010 10
13 oct. 2008 à 00:19
re juste que j'ai trouvé ça marche merci
1