Javascript : galerie d'images

Fermé
miltonis Messages postés 238 Date d'inscription mercredi 6 octobre 2004 Statut Membre Dernière intervention 30 septembre 2022 - 6 avril 2005 à 18:15
 miltonis - 6 avril 2005 à 21:13
Bonjour à tous,

j'ai télchargé un script sur le net que j'ai modifié à ma sauce car la versio d'origine ne me convenait pas totalement.

Mais, probleme, les images ne s'affichent pas toutes lorsqu'ion clique sur les boutons "suivant / "precedent", seulement la première.

voici mon code si des ames bienveillantes et courageueses peuvent me donner un coup de main :

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<SCRIPT>
<!-- Hide script from older browsers
	thisImg = 1
	imgCt = 5

	function newSlide(direction) {	
		if (document.images) {
			thisImg = thisImg + direction
			if (thisImg < 1) {
				thisImg = imgCt
			}
			if (thisImg > imgCt) {
				thisImg=1
			}
			document.slider.src = thisImg + ".jpg"
		}
	}
	// stop hiding script -->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
function afficheVignette(cheminVignette,cheminMaxi)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
	}
function afficheMaxi(chemin)
	{
	i1 = new Image;
	i1.src = chemin;

	html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><center><table border="0" width="32%"><tr><td width="34%" colspan="3"><p align="center"><img SRC="2.jpg" width="500" height="460" BORDER="0" ALIGN="middle" name="slider"></td></tr><tr><td width="33%"><p align="left"><a HREF="javascript:newSlide(-1)"><img SRC="suiteg.jpg" WIDTH="29" HEIGHT="32" ALIGN="bottom" border="0"></a></td><td width="33%"></td><td width="34%"><p align="right"><a HREF="javascript:newSlide(1)"><img SRC="suited.jpg" WIDTH="29" HEIGHT="28" ALIGN="bottom" border="0"></a></td></tr></table></center></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	};
</SCRIPT>	
</head>

<body>
<SCRIPT LANGUAGE="JavaScript">
	afficheVignette("01.jpg","1.jpg");
	afficheVignette("02.jpg","2.jpg");
	afficheVignette("03.jpg","3.jpg");
	afficheVignette("04.jpg","4.jpg");
	afficheVignette("05.jpg","5.jpg");
</SCRIPT>
</body>
</html>


merci par avance de toute réponse

2 réponses

miltonis Messages postés 238 Date d'inscription mercredi 6 octobre 2004 Statut Membre Dernière intervention 30 septembre 2022 19
6 avril 2005 à 18:23
pour mieux comprendre :
http://chorreradelindio.tiscali.fr/tofs/vignettes.html

merci encore
0