IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

display=block sur un <tr> ne fonctionne pas sur Chrome qui connait ?


Sujet :

JavaScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2016
    Messages
    83
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2016
    Messages : 83
    Par défaut display=block sur un <tr> ne fonctionne pas sur Chrome qui connait ?
    Qui peut m'aider à faire fonctionner ceci sur Chrome ? Ça fonctionne avec Internet Explorer
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    <html>
     
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>test</title>
    <script type="text/javascript">
    function Change1() {
     
    if ((document.getElementById('Noeuds').checked) ) {
    document.getElementById('N').style.display="block";
    }
    else {
    document.getElementById('N').style.display="none";
     
    }
    }
    function Change2() {
     
    if ((document.getElementById('Km').checked) ) {
    document.getElementById('K').style.display="block";
    }
    else {
    document.getElementById('K').style.display="none";
     
    }
    }
     
    </script>    
    </head>
     
    <body>
     
    <FORM style="font-family: Verdana, sans-serif; font-size: 12px; color: #464646">
    <INPUT type=checkbox name="Noeuds" value="Noeuds" id= "Noeuds" onclick="Change1()"> Noeuds
    <INPUT type=checkbox name="Km" value="Km" id= "Km" onclick="Change2()" > Km/h
    </FORM>
    <table border="0" width="641" cellpadding="0" style="border:1px solid #B5CEDE; border-radius: 5px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px">
    	<tr>
    		<td>
    		<p style="margin-left: 10px"><font face="Verdana" style="font-size: 9">
    <img src="colored_0_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_1_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_2_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_3_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_4_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_5_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_6_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_7_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_8_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    		<td>
    <img src="colored_9_W.gif?v=2" alt="" style="vertical-align: miple"></font></td>
    	</tr>
    	<tr>
    		<td>
    		<p style="margin-left: 10px"><font face="Verdana" style="color: rgb(70, 70, 70); font-family: Verdana, sans-serif; font-size: 12px;">1&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(70, 70, 70); font-family: Verdana, sans-serif; font-size: 12px">2&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(34, 211, 34); font-family: Verdana, sans-serif; font-size: 12px">3&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(34, 211, 34); font-family: Verdana, sans-serif; font-size: 12px">4&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(255, 115, 68); font-family: Verdana, sans-serif; font-size: 12px">5&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(255, 115, 68); font-family: Verdana, sans-serif; font-size: 12px">6&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(255, 4, 4); font-family: Verdana, sans-serif; font-size: 12px">7&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(210, 30, 120); font-family: Verdana, sans-serif; font-size: 12px">8&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(102, 0, 102); font-family: Verdana, sans-serif; font-size: 12px">9,5&nbsp;Bft</font></td>
    		<td><font face="Verdana" style="color: rgb(102, 0, 102); font-family: Verdana, sans-serif; font-size: 12px">11&nbsp;Bft</font></td>
    	</tr>
    	<tr  id= "N" style="display:none">
    		<td>
    		<p style="margin-left: 10px">
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #464646">
    		2 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #464646">
    		4 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #22D322">
    		10 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #22D322">
    		13 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF7344">
    		19 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF7344">
    		23 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF0404">
    		29 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #D21E78">
    		39 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #660066">
    		49 Nd</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #660066">
    		62 Nd</span></td>
    	</tr>
    	<tr  id="K" style="display:none">
    		<td>
    		<p style="margin-left: 10px">
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #464646">
    		4 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #464646">
    		7 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #22D322">
    		18 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #22D322">
    		25 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF7344">
    		36 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF7344">
    		43 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #FF0404">
    		54 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #D21E78">
    		72 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #660066">
    		90 Km/h</span></td>
    		<td>
    		<span style="font-family: Verdana, sans-serif; font-size: 12px; color: #660066">
    		115 Km/h</span></td>
    	</tr>
    </table>
     
    </body>
     
    </html>

  2. #2
    Rédacteur/Modérateur

    Avatar de SylvainPV
    Profil pro
    Inscrit en
    Novembre 2012
    Messages
    3 375
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2012
    Messages : 3 375
    Par défaut
    La prochaine fois, pense à décrire précisément le comportement attendu et le résultat observé.

    Le mode d'affichage normal de la balise tr est "table-row", et non "block".

    Une manière plus propre d'alterner l'affichage d'un élément est d'utiliser la propriété hidden:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    document.getElementById('N').hidden = !document.getElementById('Noeuds').checked;
    démo: http://jsbin.com/huqejokuku/edit?html,output

  3. #3
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2016
    Messages
    83
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2016
    Messages : 83
    Par défaut
    Merci. Tout est rentré dans l'ordre
    Déso pour ma mauvaise explication, il était tard et j'étais fatigué.
    Merci pour ton aide.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Double clique sur ligne d'un datagrid ne fonctionne pas sur ecran tactile
    Par slacky dans le forum Windows Presentation Foundation
    Réponses: 0
    Dernier message: 07/05/2012, 16h43
  2. Réponses: 7
    Dernier message: 10/02/2006, 18h00
  3. TXMLDocument, ne fonctionne pas sur tous les PC
    Par Neilos dans le forum C++Builder
    Réponses: 4
    Dernier message: 05/10/2005, 22h33
  4. Code qui ne fonctionne pas sur Mac
    Par malbaladejo dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 14/01/2005, 11h08
  5. un count sur une jointure et ca ne fonctionne pas
    Par elbronziero dans le forum Langage SQL
    Réponses: 2
    Dernier message: 14/10/2004, 11h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo