Incompatibilite IE / FX

Résolu/Fermé
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007 - 18 oct. 2007 à 15:00
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007 - 8 nov. 2007 à 16:32
Bonjour,

Je travaille sur une sorte de pavé (de validation) qui permet d'ouvrir des 'divs' et en cacher toutes les autres quand on le selectionne.

Ce pavé fonctionne très bien sous IE mais pas trop sous FX. En fait c'est (je pense) la fonction HideShow_td() qui a du mal à fonctionner sous FX car il devient possible d'ouvrir plusieurs modes de validation (dans cet exemple 2) en même tps.

Voici le code de ce pavé :

<table border="0" cellspacing="0" cellpadding="0" width="65%" align="center" class="tableauCadre">
<tr>
<th id="th_titleButton" class="tdTitreFondBleuGauche" nowrap valign="middle" align="left"><IMG src="../gif/px.gif" height="13" width="13"><span class="V11blancGras">  Mode de validation </span></th>
<td align="right" class="tdTitreFondBleuGauche">
<div id="div_button">
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td class="tdSautLigne5px"></td>
</tr>
<tr>
<TD CLASS="tdBtGaucheBleu"></TD>
<TD CLASS="tdBtCentreBleu" nowrap="nowrap"><A href="javascript:showAll('certif','div_lc','div_lsf','div_mdp');" class="navbasGrasBlanc">Autre mode de validation</A></TD>
<TD CLASS="tdBtDroiteBleu"></TD>
<TD>   </TD>
</tr>
<tr>
<td class="tdSautLigne5px"></td>
</tr>
</table>
</div>
</td>
<td align="right" class="tdTitreFondBleuGauche">
<div id="div_retour" style="display:none;">
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td class="tdSautLigne5px"></td>
</tr>
<tr>
<TD CLASS="tdBtGaucheBleu"></TD>
<TD CLASS="tdBtCentreBleu" nowrap="nowrap"><A href="javascript:hideAll('certif','div_lc');" class="navbasGrasBlanc">Retour</A></TD>
<TD CLASS="tdBtDroiteBleu"></TD>
<TD>   </TD>
</tr>
<tr>
<td class="tdSautLigne5px"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="tdSautLigne15px"></td>
</tr>
<tr>
<td colspan="3">
<div id="div_certif" >
<table border="0" cellspacing="0" cellpadding="0" width="80%" align="center">
<tr>
<td class="tdSouligne"></td>
</tr>
<tr>
<td id="td_certif1" class="titre" valign="middle" nowrap="nowrap"><img src="../gif/px.gif" border="0" width="15" height="15" align="left" > Certificat numérique</td>
<td width="100%" align="left" class="titre" id="td_certif" style="display:none;" >
<a id="a_certif" valign="middle" href="javascript:hideShow_td('certif','lc');" class="titre"><img src="../gif/select_down.gif" border="0" width="15" height="15" align="left" id="img_certif" name="image"> Certificat numérique </a>
</td>
</tr>
<tr>
<td align="left" >
<div id="certif" class="tableauColor">
<table border="0" cellspacing="0" cellpadding="0" width="60%" align="center">
<tr>
<td class="tdSautLigne20px" colspan="3"></td>
</tr>
<tr>
<td>
<img src="../../Accueil/fr/images/valider_certification_3d.gif" alt="Certificat" border="0" style="margin-left: 18px; margin-right: 18px;" height="76" /></td>
<td width="5%"></td>
<td width="70%">
<a href="
#" title="Par lecteur connecté"><span class="V11bleuGras">Cliquez ici pour valider</span></a></td>
</tr>
<tr>
<td class="tdSautLigne20px" colspan="3"></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="div_lc" style="display:none;">
<table border="0" cellspacing="0" cellpadding="0" width="80%" align="center">
<tr>
<td class="tdSouligne"></td>
</tr>
<tr>
<td id="td_lc1" class="titre" valign="middle" nowrap="nowrap" style="display:none;"><img src="../gif/px.gif" border="0" width="15" height="15" align="left" > Carte TS et lecteur connecté</td>
<td width="100%" align="left" class="titre" id="td_lc">
<a id="a_lc" valign="middle" href="javascript:hideShow_td('lc','certif');" class="titre"><img src="../gif/select_down.gif" border="0" width="15" height="15" align="left" id="img_lc" name="image"> Carte TS et lecteur connecté </a>
</td>
</tr>
<tr>
<td align="left" >
<div id="lc" class="tableauColor" style="display:none">
<table border="0" cellspacing="0" cellpadding="0" width="60%" align="center">
<tr>
<td class="tdSautLigne20px" colspan="3"></td>
</tr>
<tr>
<td>
<img src="../../Accueil/fr/images/lecteur_connecte.gif" alt="Lecteur connecté" border="0" style="margin-left: 18px; margin-right: 18px;" height="76" /></td>
<td width="5%"></td>
<td width="70%">

<a href="#" title="Par lecteur connecté"><span class="V11bleuGras">Cliquez ici pour valider</span></a></td>
</tr>
<tr>
<td class="tdSautLigne20px" colspan="3"></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</td>
</tr>

<tr>
<td colspan="3">

</td>
</tr>
<tr>
<td colspan="3">

</td>
</tr>
<tr>
<td colspan="3" class="tdSautLigne15px"></td>
</tr>
</table>


Et voici les fonctions javascript qui vont avec :

function showAll(){
var toHide,i,obj,args=showAll.arguments;
if(document.getElementById){
//on cache l'element affiché
toHide= document.getElementById(args[0]);
toHide.style.display = "none";
document.getElementById("td_"+args[0]+"1").style.display="none";
document.getElementById("td_"+args[0]).style.display="";

for (i=1; i<(args.length); i++)
if ((obj=document.getElementById(args[i]))!=null) {
if (obj.style) {
obj.style.display="";
}
}
document.getElementById("div_button").style.display="none";
document.getElementById("div_retour").style.display="";
}
}

function hideAll(){
var toShow,i,obj,args=hideAll.arguments;
if(document.getElementById){
//on cache l'element affiché
toShow= document.getElementById(args[0]);
toShow.style.display = "";
document.getElementById("td_"+args[0]+"1").style.display="";
document.getElementById("td_"+args[0]).style.display="none";

for (i=1; i<(args.length); i++)
if ((obj=document.getElementById(args[i]))!=null) {
if (obj.style) {
obj.style.display="none";
}
}
document.getElementById("div_button").style.display="";
document.getElementById("div_retour").style.display="none";
}
}

function hideShow_td() { //v1.0
var toShow,i,obj,args=hideShow_td.arguments;
//cacher ou afficher le bloc selectionné
toShow=document.getElementById(args[0]);
//toShow=MM_findObj(args[0]);
if (toShow.style.display == ""){
toShow.style.display = "none";
document.form.image["img_"+args[0]].src="../gif/select_down.gif";
}else{
toShow.style.display = "";
changeBackground("../bg_validation.gif",args[0]);
document.form.image["img_"+args[0]].src="../gif/select_up.gif";

}
//cacher les autres blocs
for (i=1; i<(args.length); i++)
if ((obj=document.getElementById(args[i]))!=null) {
if (obj.style) {
obj.style.display='none';
changeBackground("",args[i]);
document.form.image["img_"+args[i]].src="../gif/select_down.gif";
}
}

//radio=args[args.length-1];
//radio=args[0]+"_radio";
//document.form.radiobutton[radio].checked="true";
}
function hideDiv(hideShow) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(hideShow).style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'hidden';
}
else { // IE 4
document.all.hideShow.style.visibility = 'hidden';
}
}


}


Merci de pour votre aide car là je suis vraiment coincé!

5 réponses

Reivax962 Messages postés 3671 Date d'inscription jeudi 16 juin 2005 Statut Membre Dernière intervention 11 février 2021 1 011
18 oct. 2007 à 15:12
Je ne sais pas, chez moi ça ne pas de problème quand je l'exécute sous FF (sauf changeBackground() que tu n'as pas mise là)...

Si tu ouvres la console d'erreur (Outils -> Console d'erreurs), que tu la vide (pour faire le ménage), et que tu cliques un peu partout sur ton site, tu devrais y voir apparaître toutes les erreurs détectées...
0
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007
18 oct. 2007 à 15:52
Salut Reivax962,

Merci pour ta réponse.

Mais le problème si tu veux, c'est que tout marche niquel à part que sous FX on peut ouvrir les 2 modes de validation en même tps! Alors que sous IE il en cache forcemment l'un pour faire afficher l'autre.

Si tu veux, quand tu ouvres la pages, clique sur "autre mode de validation" puis clique sur certificat munerique et sur lecteur connecte et tu verras la difference entre IE et FX.

Voici la fonction changeBackground :

function changeBackground(img,id){
var nom_image, longueur, image, chemin;
//rajouter le test si l'element n'est pas selectionné
//nom_image = document.images["img_"+id].src;
//longueur = nom_image.length;
//image = nom_image.substr(longueur - 7, longueur);
//chemin = nom_image.substr(0, longueur - 7);

//if (nom_image == "../gif/select_down.gif"){
document.getElementById("td_"+id).background=img;
//}
}


Au fait de quelle version de FX dispose-tu? Moi j'ai la 2.0.

Merci encore et à plus tard.
0
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007
19 oct. 2007 à 11:48
Merci de m'aider si vous le pouvez car mon problème n'est tjs pas résolu :'(
0
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007
24 oct. 2007 à 11:10
Mon problème persiste!
Quelqu'un pourrait-il m'aider?
Merci :'(
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
KHENOUZ Messages postés 5 Date d'inscription vendredi 3 août 2007 Statut Membre Dernière intervention 8 novembre 2007
8 nov. 2007 à 16:32
Mon problème est résolu!

Il fallait modifier un peu la syntaxe de la fonction javascript hideshow() et le tour est joué!

++
0