Javascript
yann5
Messages postés
398
Date d'inscription
Statut
Membre
Dernière intervention
-
yann5 Messages postés 398 Date d'inscription Statut Membre Dernière intervention -
yann5 Messages postés 398 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
j'aimerais faire une gallerie d'images simple donc j'ai fais ce code :
<head>
<script language="JavaScript">
window.onload = "var photo='1'";
function verifPhoto(action) {
if (action==suiv) {photo++;}
if (action==prec) {photo--;}
switch (photo) {
case '1':
document.getElementByName(photo).src ='http://wakstep.u7n.org/include/img/minis/frederic.JPG';
document.getElementByName(photo).alt = 'Frédéric';
break;
default:
document.getElementsByName(photo).src = 'http://wakstep.u7n.org/include/img/noimage.gif';
document.getElementByName(photo).alt = 'Fin de liste';
break;
}
if (photo<='0') {photo='1';}
if (photo>='2') {photo='1';} // photo = dernière photo (num)
}
</script>
</HEAD>
<BODY OnLoad="var photo='1'">
<table align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2" height="22"><center>
<img name="photo" src="http://wakstep.u7n.org/include/img/minis/frederic.JPG" alt="Frédéric" />
</center>
</td>
</tr>
<tr>
<td width="50%" nowrap><p align="left"><a href="JAVASCRIPT:" onClick="verifPhoto('prec')"><font size='3' color='red'>Image Précédente</font></a></td>
<td width="50%" nowrap><p align="right"><a href="JAVASCRIPT:" onClick="verifPhoto('suiv')"><font size='3' color='red'>Image Suivante</font></a></td>
</tr>
</table>
</body>
Mais quand je fais image précédente ou image suivante on devrait m'afficher http://wakstep.u7n.org/include/img/noimage.gif mais rien.
j'aimerais faire une gallerie d'images simple donc j'ai fais ce code :
<head>
<script language="JavaScript">
window.onload = "var photo='1'";
function verifPhoto(action) {
if (action==suiv) {photo++;}
if (action==prec) {photo--;}
switch (photo) {
case '1':
document.getElementByName(photo).src ='http://wakstep.u7n.org/include/img/minis/frederic.JPG';
document.getElementByName(photo).alt = 'Frédéric';
break;
default:
document.getElementsByName(photo).src = 'http://wakstep.u7n.org/include/img/noimage.gif';
document.getElementByName(photo).alt = 'Fin de liste';
break;
}
if (photo<='0') {photo='1';}
if (photo>='2') {photo='1';} // photo = dernière photo (num)
}
</script>
</HEAD>
<BODY OnLoad="var photo='1'">
<table align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2" height="22"><center>
<img name="photo" src="http://wakstep.u7n.org/include/img/minis/frederic.JPG" alt="Frédéric" />
</center>
</td>
</tr>
<tr>
<td width="50%" nowrap><p align="left"><a href="JAVASCRIPT:" onClick="verifPhoto('prec')"><font size='3' color='red'>Image Précédente</font></a></td>
<td width="50%" nowrap><p align="right"><a href="JAVASCRIPT:" onClick="verifPhoto('suiv')"><font size='3' color='red'>Image Suivante</font></a></td>
</tr>
</table>
</body>
Mais quand je fais image précédente ou image suivante on devrait m'afficher http://wakstep.u7n.org/include/img/noimage.gif mais rien.