Rendre visible ou invisible une Div
Décidemment je ne m'en sortirais pas, j'ai complété mon code avec une nouvelle fonction, et celle-ci ne fonctionne pas :
Code:
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
| function SMatMet() {
if(document.getElementById('Machine_tridimensionnelle').checked)
{
document.getElementById('Limage').src='images/Machines/CONT1.jpg'
document.getElementById('NomMach').innerHTML='ZEISS';
document.getElementById('Mach').innerHTML='Machine à mesurer tridimensionnelle';
document.getElementById('Specifi').innerHTML='Courses 1000x1200x600';
}
if(document.getElementById('Machine_tridimensionnelle1').checked)
{
document.getElementById('Limage').src='images/Machines/LS2.jpg'
document.getElementById('NomMach').innerHTML='TESA';
document.getElementById('Mach').innerHTML='Machine à mesurer tridimensionnelle';
document.getElementById('Specifi').innerHTML='Courses 600x500x400';
}
if(document.getElementById('Projecteur_profil').checked)
{
document.getElementById('Limage').src='images/Machines/LS3.jpg'
document.getElementById('NomMach').innerHTML='TESA';
document.getElementById('Mach').innerHTML='Projecteur de profil avec calculateur';
document.getElementById('Specifi').innerHTML=' ';
}
if(document.getElementById('Colonne_contrôle').checked)
{
document.getElementById('Limage').src='images/Machines/LS1.jpg'
document.getElementById('NomMach').innerHTML=' ';
document.getElementById('Mach').innerHTML='Colonne de contrôle ';
document.getElementById('Specifi').innerHTML='Hauteur 500';
}
if(document.getElementById('Colonne_contrôle1').checked)
{
document.getElementById('Limage').src='images/Machines/CONT2.jpg'
document.getElementById('NomMach').innerHTML=' ';
document.getElementById('Mach').innerHTML='Colonne de contrôle ';
document.getElementById('Specifi').innerHTML='Hauteur 600';
}
} |
Ce qui donne mon code complet :
Code:
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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title></title>
<script type="text/javascript">
function Smachine() {
if(document.getElementById('Mat_fabrication').checked)
{
document.getElementById('Limage').src='images/Machines/OKUMA_3.jpg'
document.getElementById('NomMach').innerHTML='OKUMA';
document.getElementById('MatFabrication').style.display='block';
document.getElementById('AssFabrication').style.display='none';
document.getElementById('MatMetrologie').style.display='none';
}
if(document.getElementById('Ass_fabrication').checked)
{
document.getElementById('Limage').src='images/Machines/A7.jpg'
document.getElementById('NomMach').innerHTML='MASTERCAM';
document.getElementById('MatFabrication').style.display='none';
document.getElementById('AssFabrication').style.display='block';
document.getElementById('MatMetrologie').style.display='none';
}
if(document.getElementById('Mat_metrologie').checked)
{
document.getElementById('Limage').src='images/Machines/CONT1.jpg'
document.getElementById('NomMach').innerHTML='ZEISS';
document.getElementById('MatFabrication').style.display='none';
document.getElementById('AssFabrication').style.display='none';
document.getElementById('MatMetrologie').style.display='block';
}
}
function SAssFab() {
if(document.getElementById('Station_FAO_2D').checked)
{
document.getElementById('Limage').src='images/Machines/A7.jpg'
document.getElementById('NomMach').innerHTML='MASTERCAM';
document.getElementById('Mach').innerHTML='Station FAO 2D et ED';
document.getElementById('Specifi').innerHTML=' ';
}
if(document.getElementById('Station_FAO').checked)
{
document.getElementById('Limage').src='images/Machines/A7.jpg'
document.getElementById('NomMach').innerHTML='MASTERCAM';
document.getElementById('Mach').innerHTML='Station FAO Tournage 4 axes, électrofil';
document.getElementById('Specifi').innerHTML=' ';
}
if(document.getElementById('Station_CAO').checked)
{
document.getElementById('Limage').src='images/Machines/A7.jpg'
document.getElementById('NomMach').innerHTML='SOLIDWORKS';
document.getElementById('Mach').innerHTML='Station CAO 2D et ED';
document.getElementById('Specifi').innerHTML=' ';
}
}
function SMatMet() {
if(document.getElementById('Machine_tridimensionnelle').checked)
{
document.getElementById('Limage').src='images/Machines/CONT1.jpg'
document.getElementById('NomMach').innerHTML='ZEISS';
document.getElementById('Mach').innerHTML='Machine à mesurer tridimensionnelle';
document.getElementById('Specifi').innerHTML='Courses 1000x1200x600';
}
if(document.getElementById('Machine_tridimensionnelle1').checked)
{
document.getElementById('Limage').src='images/Machines/LS2.jpg'
document.getElementById('NomMach').innerHTML='TESA';
document.getElementById('Mach').innerHTML='Machine à mesurer tridimensionnelle';
document.getElementById('Specifi').innerHTML='Courses 600x500x400';
}
if(document.getElementById('Projecteur_profil').checked)
{
document.getElementById('Limage').src='images/Machines/LS3.jpg'
document.getElementById('NomMach').innerHTML='TESA';
document.getElementById('Mach').innerHTML='Projecteur de profil avec calculateur';
document.getElementById('Specifi').innerHTML=' ';
}
if(document.getElementById('Colonne_contrôle').checked)
{
document.getElementById('Limage').src='images/Machines/LS1.jpg'
document.getElementById('NomMach').innerHTML=' ';
document.getElementById('Mach').innerHTML='Colonne de contrôle ';
document.getElementById('Specifi').innerHTML='Hauteur 500';
}
if(document.getElementById('Colonne_contrôle1').checked)
{
document.getElementById('Limage').src='images/Machines/CONT2.jpg'
document.getElementById('NomMach').innerHTML=' ';
document.getElementById('Mach').innerHTML='Colonne de contrôle ';
document.getElementById('Specifi').innerHTML='Hauteur 600';
}
}
</script>
</head>
<body>
<table style="width: 700px; height: auto;" >
<tr>
<td align="center">
<table style="border: 4px solid #2A3E72; width: 500px">
<tr>
<td colspan="2"
style="background-color: #2A3E72; color: #C0C0C0; font-size: 16px; font-weight: bold; text-align:center">
NOTRE PARC MACHINES
</td>
</tr>
<tr>
<td colspan="2">
<div id="Itype">
<input name="Type" id="Mat_fabrication" type="radio" value="Materielfabrication" checked="checked" onclick="Smachine();" />Matériel de fabrication
<input name="Type" id="Ass_fabrication" type="radio" value="Assistancefabrication" onclick="Smachine();" />Assistance à la fabrication
<input name="Type" id="Mat_metrologie" type="radio" value="Materielmetrologie" onclick="Smachine();" />Matériel de métrologie
</div>
</td>
</tr>
<tr>
<td colspan="2">
<table id="TbPresente" class="style1">
<tr>
<td style="width: 188px" align="center">
<div id="Isecteur">
<img id="Limage" src="images/Machines/OKUMA_3.jpg" />
<p id="Mach">Bi broche axe B avec ravitailleur<br />Passage broche Dia 65</p><br />
<p id="NomMach">OKUMA</p>
</div>
</td>
<td style="width: 312px">
<table class="style1">
<tr>
<td align="center" style="padding-bottom: 5px; font-weight: bold; text-decoration: underline overline;">
</td>
</tr>
<tr>
<td align="left" style="padding-bottom: 5px; padding-left: 10px">
<div id="MatFabrication" style="display:block;">
<input name="Fabrication" id="Tour1" type="radio" value="Centretournage" checked="checked" onclick="SMatFab();" />Centre de tournage<br />
<input name="Fabrication" id="Tour2" type="radio" value="TourCN6axes" onclick="SMatFab();" />Tour CN 6 axes<br />
<input name="Fabrication" id="Tour3" type="radio" value="TourCN4axesEP600" onclick="SMatFab();" />Tour CN 4 axes EP 600<br />
<input name="Fabrication" id="Tour4" type="radio" value="TourCN4axesEP1000" onclick="SMatFab();" />Tour CN 4 axes EP 1000<br />
<input name="Fabrication" id="Tour5" type="radio" value="TourCNEP600" onclick="SMatFab();" />Tour CN EP 600<br />
<input name="Fabrication" id="Tour6" type="radio" value="TourCNEP1150" onclick="SMatFab();" />Tour CN EP 1150<br />
<input name="Fabrication" id="CU1" type="radio" value="Centreusinage4axes" onclick="SMatFab();" />Centre d'usinage 4 axes<br />
<input name="Fabrication" id="CU2" type="radio" value="Centreusinage4axesUGV" onclick="SMatFab();" />Centre d'usinage 4 axes UGV<br />
<input name="Fabrication" id="CU3" type="radio" value="Centreusinage5axesUGV" onclick="SMatFab();" />Centre d'usinage 5 axes UGV<br />
<input name="Fabrication" id="CU4" type="radio" value="Centreusinage5axesUGV1" onclick="SMatFab();" />Centre d'usinage 5 axes UGV<br />
<input name="Fabrication" id="EE" type="radio" value="Electroérosion" onclick="SMatFab();" />Electro-érosion<br />
<input name="Fabrication" id="SA" type="radio" value="Scieautomatique" onclick="SMatFab();" />Scie automatique<br />
</div>
<div id="AssFabrication" style="display:none;">
<input name="Assistance" id="Station_FAO_2D" type="radio" value="StationFAO2DetED" checked="checked" onclick="SAssFab();" />Station FAO 2D et ED<br />
<input name="Assistance" id="Station_FAO" type="radio" value="StationFAO Tournage4axeselectrofil" onclick="SAssFab();" />Station FAO Tournage 4 axes, électrofil<br />
<input name="Assistance" id="Station_CAO" type="radio" value="StationCAO2DetED" onclick="SAssFab();" />Station CAO 2D et ED<br />
</div>
<div id="MatMetrologie" style="display:none;">
<input name="Metrologie" id="Machine_tridimensionnelle" type="radio" value="Machineàmesurertridimensionnelle" checked="checked" onclick="SMatMet();" />Machine à mesurer tridimensionnelle<br />
<input name="Metrologie" id="Machine_tridimensionnelle1" type="radio" value="Machineàmesurertridimensionnelle1" onclick="SMatMet();" />Machine à mesurer tridimensionnelle<br />
<input name="Metrologie" id="Projecteur_profil" type="radio" value="Projecteurdeprofilaveccalculateur" onclick="SMatMet();" />Projecteur de profil avec calculateur<br />
<input name="Metrologie" id="Colonne_contrôle" type="radio" value="Colonnedecontrôle" onclick="SMatMet();" />Colonne de contrôle<br />
<input name="Metrologie" id="Colonne_contrôle1" type="radio" value="Colonnedecontrôle1" onclick="SMatMet();" />Colonne de contrôle<br />
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="padding-top: 10px; padding-bottom: 10px; padding-left: 10px;text-align:center">
<p id="Specifi">Bi broche axe B avec ravitailleur Passage broche Dia 65</p>
</td>
</tr>
<tr>
<td colspan="2" style="border: thin solid #7B7DA3;text-align:center">
Type de pièces fabriquées avec cette machine
</td>
</tr>
<tr>
<td colspan="2" style="border: thin solid #7B7DA3;text-align:center">
<img src="images/Materiel/P1.jpg" />
<img src="images/Materiel/P2.jpg" />
<img src="images/Materiel/P3.jpg" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html> |