Bonsoir à toutes et à tous !
J'ai créé une page web (entre autres) pour mon boulot sous firefox, et seule une partie du javascript fonctionne.
Je pense que le problème se situe au niveau des id qui ne sont pas reconnus par ie dans certaines circonstances.
Comment passer outre ?
Je ne vous cache pas que c'est urgent, alors une idée frétille dans votre esprit ? N'hésiter pas, c'est mauvais pour la santé !
Voici le code source de la page : (remplacez les images du menu si besoin est)
Les effets des boutons du menu ne fonctionneront pas sans les sources JS scriptaculous, mais le code javascript qui pose problème est quand à lui présent sur la page. (il vaut mieux)
(Je précise tout de suite que le javascript est activé sur mon navigateur IE, donc je ne pense pas que le problème puisse venir de là ^^)
---------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="language" content="french" />
<title>Casa Mamma</title>
<meta name="description" content="Le site des givrés du premier de l'an" />
<meta name="keywords" content="givrés, dunkerque" />
<meta name="author" content="MeMento" />
<link href="style1024.css" rel="stylesheet" type="text/css">
<!-- PE : Faire au cas par cas pour les résolution : JAVASCRIPT + PHP pour choisir le style.css -->
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
//Déclaration des variables globales :
variable1=1;
variable2=1;
variable3=1;
variable4=1;
titredem1='alexandre';
titredem2='alexandre';
titredem3='alexandre';
titredem4='alexandre';
function charger1(){
if (variable1 == 1){
titredem1 = document.getElementById("item1").parentNode.parentNode.innerHTML;
document.getElementById("item1").parentNode.parentNode.innerHTML+='<tr><td ><a href="uncredo.html"onFocus="this.blur()" target="affichage"><img border="0" id="uncredo" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'uncredo\'); new Effect.Appear(\'uncredo\');" src="images/menu1440/sousmenu/uncredo.jpg" /></a></td></tr><tr><td><a href="vousconseiller.html"onFocus="this.blur()" target="affichage"><img border="0" id="vousconseiller" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'vousconseiller\'); new Effect.Appear(\'vousconseiller\');" src="images/menu1440/sousmenu/vousconseiller.jpg" /></a></td></tr><tr><td><a href="vousaccompagner.html"onFocus="this.blur()" target="affichage"><img border="0" id="vousaccompagner" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'vousaccompagner\'); new Effect.Appear(\'vousaccompagner\');" src="images/menu1440/sousmenu/vousaccompagner.jpg" /></a></td></tr>';
new Effect.Appear('notredemarche');
variable1*=-1;
}else{
document.getElementById("item1").parentNode.parentNode.innerHTML=titredem1;
new Effect.Appear('notredemarche');
variable1*=-1;
}
}
function charger2(){
if (variable2 == 1){
titredem2 = document.getElementById("item2").innerHTML;
document.getElementById("item2").innerHTML+='<tr><td><a href="audit.html"onFocus="this.blur()" target="affichage"><img border="0" id="audit" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'audit\'); new Effect.Appear(\'audit\');" src="images/menu1440/sousmenu/audit.jpg" /></a></td></tr><tr><td><a href="actionsetoutils.html"onFocus="this.blur()" target="affichage"><img border="0" id="actionsetoutils" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'actionsetoutils\'); new Effect.Appear(\'actionsetoutils\');" src="images/menu1440/sousmenu/actionsetoutils.jpg" /></a></td></tr><tr><td><a href="mediatraining.html"onFocus="this.blur()" target="affichage"><img border="0" id="mediatraining" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'mediatraining\'); new Effect.Appear(\'mediatraining\');" src="images/menu1440/sousmenu/mediatraining.jpg" /></a></td></tr><tr><td><a href="formation.html"onFocus="this.blur()" target="affichage"><img border="0" id="formation" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'formation\'); new Effect.Appear(\'formation\');" src="images/menu1440/sousmenu/formation.jpg" /></a></td></tr>';
new Effect.Appear('nosservices');
variable2*=-1;
}else{
document.getElementById("item2").innerHTML=titredem2;
new Effect.Appear('nosservices');
variable2*=-1;
}
}
function charger3(){
if (variable3 == 1){
titredem3 = document.getElementById("item3").innerHTML;
document.getElementById("item3").innerHTML+='<tr><td><a href="entreprises.html"onFocus="this.blur()" target="affichage"><img border="0" id="entreprises" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'entreprises\'); new Effect.Appear(\'entreprises\');" src="images/menu1440/sousmenu/entreprises.jpg" /></a></td></tr><tr><td><a href="institutions.html"onFocus="this.blur()" target="affichage"><img border="0" id="institutions" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'institutions\'); new Effect.Appear(\'institutions\');" src="images/menu1440/sousmenu/institutions.jpg" /></a></td></tr><tr><td><a href="formations.html"onFocus="this.blur()" target="affichage"><img border="0" id="formations" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'formations\'); new Effect.Appear(\'formations\');" src="images/menu1440/sousmenu/formations.jpg" /></a></td></tr>';
new Effect.Appear('nosreferences');
variable3*=-1;
}else{
document.getElementById("item3").innerHTML=titredem3;
new Effect.Appear('nosreferences');
variable3*=-1;
}
}
function charger4(){
if (variable4 == 1){
titredem4 = document.getElementById("item4").innerHTML;
document.getElementById("item4").innerHTML+='<tr><td><a href="votreequipe.html"onFocus="this.blur()" target="affichage"><img border="0" id="votreequipe" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'votreequipe\'); new Effect.Appear(\'votreequipe\');" src="images/menu1440/sousmenu/votreequipe.jpg" /></a></td></tr><tr><td><a href="veniralacasa.html"onFocus="this.blur()" target="affichage"><img border="0" id="veniralacasa" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide(\'veniralacasa\'); new Effect.Appear(\'veniralacasa\');" src="images/menu1440/sousmenu/veniralacasa.jpg" /></a></td></tr>';
new Effect.Appear('nouscontacter');
variable4*=-1;
}else{
document.getElementById("item4").innerHTML=titredem4;
new Effect.Appear('nouscontacter');
variable4*=-1;
}
}
</script>
</head>
<body align="center" onLoad="alert(document.getElementById('item1').previousSibling.nodeName)">
<table class="cadre" border=1 cellspacing=0 width="70%" height="100%">
<tr height="142px" >
<td class="logo" width="30%"><img src="images/logo.jpg" alt="Casa Mamma" /></td>
<td rowspan=2> <iframe src="accueil.html" style="margin: 0px 0px 0px 0px ; padding:0px 0px 0px 0px ;" class="iframe" name="affichage" frameborder="0" ></iframe> </td>
</tr>
<tr height="80%" class="menu">
<td align="left">
<table height="100%" border=0 align="center">
<tr border=0 >
<td height=34 class="casemenu">
<!--ICI on met une nouvelle table -->
<table height="100%" border=0 align="center">
<tr>
<td id="item1" onclick="charger1()" ><a href="accueil.html"onFocus="this.blur()" target="affichage"><img border="0" id="notredemarche" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide('notredemarche'); new Effect.Appear('notredemarche');" src="images/menu1440/notredemarche.jpg" /></a></td>
<tr>
</table>
</td>
</tr>
<tr>
<td height=34 class="casemenu">
<table height="100%" border=0 id="item2" align="center">
<tr>
<td onclick="charger2()" ><a href="accueil.html"onFocus="this.blur()" target="affichage"><img border="0" id="nosservices" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide('nosservices'); new Effect.Appear('nosservices');" src="images/menu1440/nosservices.jpg" /></a></td>
<tr>
</table>
</td>
</tr>
<tr>
<td height=34 class="casemenu">
<table height="100%" border=0 id="item3" align="center">
<tr>
<td onclick="charger3()" ><a href="accueil.html"onFocus="this.blur()" target="affichage"><img border="0" id="nosreferences" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide('nosreferences'); new Effect.Appear('nosreferences');" src="images/menu1440/nosreferences.jpg" /></a></td>
<tr>
</table>
</td>
</tr>
<tr>
<td height=34 class="casemenu">
<table height="100%" border=0 id="item4" align="center">
<tr>
<td onclick="charger4()" ><a href="accueil.html"onFocus="this.blur()" target="affichage"><img border="0" id="nouscontacter" onmouseover="new Effect.ShakeVerticalAmortie(this)" onclick="Element.hide('nouscontacter'); new Effect.Appear('nouscontacter');" src="images/menu1440/nouscontacter.jpg" /></a></td>
<tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!-- onmouseover="new Effect.ShakeVerticalAmortie(this)"-->
</table>
</body>
</html>