Forum de discussion
Forum « Programmation Javascript » (archives)
Re: image changeante dans table ou image réactive à partir de plusieurs images
Envoyé: 27 juillet 2005, 9h18 par djimago2000
Voici la page concernée:http://www.freazer.com/perso/jnanethomes/pavillon1quinti.htm
Voici mon script :
<html>
<head>
<title>pavillonquinti</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
if (document.images) {
menuOn = new Array();
menuOff = new Array();
explain = new Array();
for (i=0; i<7; i++) {
menuOn[i] = new Image();
menuOff[i] = new Image();
explain[i] = new Image();
}
menuOn[0].src = "chambre.png";
menuOn[2].src = "cuisine.png";
menuOn[3].src = "douche.png";
menuOn[4].src = "jardinbas.png";
menuOn[5].src = "jardinhaut.png";
menuOn[6].src = "terrasse.png";
menuOff[0].src = "chambreoff.png";
menuOff[2].src = "cuisineoff.png";
menuOff[3].src = "doucheoff.png";
menuOff[4].src = "jardinbasoff.png";
menuOff[5].src = "jardinhautoff.png";
menuOff[6].src = "terrasseoff.png";
explainOff = new Image();
explainOff.src = "rosace.JPG";
explain[0].src = "chambre3.JPG";
explain[2].src = "cuisine2.JPG";
explain[3].src = "sallededouche.JPG";
explain[4].src = "jardinpavillon.JPG";
explain[5].src = "jardinfenetre.JPG";
explain[6].src = "terrasse1.JPG";
}
function changeMenu(act,num) {
if (document.images) {
if (act) {
document.images["menuImg"+num].src =
menuOn[num].src;
document.images["explainImg"].src =
explain[num].src;
} else {
document.images["menuImg"+num].src =
menuOff[num].src;
document.images["explainImg"].src =
explainOff.src;
}
}
}
//-->
</script>
</head>
<body>
<TD rowspan="2" width="34"><IMG src="rosace.JPG" width="34"
height="8"></TD>
<TD rowspan="2" valign="top" width="200">
<!-- /menu -->
</TD>
<TD valign="bottom" width="317">
<DIV align="left">
</DIV>
</TD>
</TR>
<TR>
<TD valign="middle" width="317" align="center"><p> </p>
<p> </p>
<table width="122%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%"><div align="right"><a href="jardin.htm" onMouseOver="changeMenu(1,5)" onMouseOut="changeMenu(0,5)"><img src="jardinhautoff.png" width="135"
height="75" border="0" alt="jardin" name="menuImg5"></a></div></td>
<td width="10%"><div align="left"><a href="cuisine.htm" onMouseOver="changeMenu(1,2)"
onMouseOut="changeMenu(0,2)"><img src="cuisineoff.png" width="86"
height="75" border="0" alt="cuisine" name="menuImg2"></a></div></td>
<td width="8%"><div align="left"><a href="sallededouche.htm" onMouseOver="changeMenu(1,3)" onMouseOut="changeMenu(0,3)"><img src="doucheoff.png" width="117" height="75" border="0" alt="salle de douche" name="menuImg3"></a></div></td>
<td width="22%" rowspan="2"> </td>
<td width="44%" rowspan="2"><img src="rosace.JPG" alt="rosace" name="explainImg" width="317" height="226"></td>
<td width="1%"> </td>
</tr>
<tr>
<td height="202"> <div align="right"><a href="jardin.htm" onMouseOver="changeMenu(1,4)"
onMouseOut="changeMenu(0,4)"><img src="jardinbasoff.png" width="134"
height="202" border="0" name="menuImg4" alt="jardin"></a></div></td>
<td><div align="left"><a href="terrasse.htm" onMouseOver="changeMenu(1,6)"
onMouseOut="changeMenu(0,6)"><img src="terrasseoff.png" width="86"
height="201" name="menuImg6" border="0" alt="terrasse"></a></div></td>
<td><div align="left"><a href="chambre.htm" onMouseOver="changeMenu(1,0)"
onMouseOut="changeMenu(0,0)"><img src="chambreoff.png" alt="chambre"
name="menuImg0" width="117" height="201" border="0"></a></div></td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p></TD>
</TR>
</body>
</html>
Que dois-je changer?
Merci de l'aide
Alex
Réponses
|