Bonjour a tous
je recherche une astuce pour afficher dans la meme page soit un code html soit l'autre selon une variable javascript comment puis je m'y prendre
merci a vous d'avance
@++
Version imprimable
Bonjour a tous
je recherche une astuce pour afficher dans la meme page soit un code html soit l'autre selon une variable javascript comment puis je m'y prendre
merci a vous d'avance
@++
bascule le display de none à block ...
Peut tu m'en dire plus ... merc a to spacefrog..@+°+
En faite je veut faire afficher ou pas afficher une balise ou pas
Selon une variable donnée..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 <TABLE BORDER="3" width="628" height="100" cellpadding="0"> <TD width="190" height="42" align="center" valign="middle"> <a href="../../MODES.STM"><img border="0" src="robot.gif" width="147" height="147"></a> </TD> <TD width="190" height="42" align="center" valign="middle"> <a href="../../op10.STM"><img src="BPOP10.gif" width="120" height="42"></a> <BR> <BR> <a href="../../op20.STM"><img src="BPOP20.gif" width="120" height="42"> </a> </TD> [AFFICHER] ou [PAS AFFICHER] <TD width="190" height="42" align="center" valign="middle"> <a href="../../potence.STM"><img src="BPpot.gif" width="120" height="42"> </a> [AFFICHER] ou [PAS AFFICHER] </TD> </TABLE>
Merci a toi
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 <html> <head> <title>Nouvelle page 1</title> <script type='text/javascript'> function toggleBody(page){ switch (page) { case "1": document.getElementById('two').style.display='block'; document.getElementById('one').style.display='none'; break; case "2": document.getElementById('one').style.display='block'; document.getElementById('two').style.display='none'; break; } } </script> </head> <body > <div id='one' style="display:block;background-color:red;"> body one <input type='button' onclick="toggleBody('1')" /><br/> Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio incongruous feline nolo contendre. Gratuitous octopus niacin, sodium glutimate. Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito. Epsum factorial non deposit quid pro quo hic escorol. Marquee selectus non provisio incongruous feline nolo contendre Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio incongruous feline nolo contendre. Gratuitous octopus niacin, sodium glutimate. Quote meon an estimate et non interruptus stadium. Sic tempus fugit esperanto hiccup estrogen. Glorious baklava ex librus hup hey ad infinitum. Non sequitur condominium facile et geranium incognito. Epsum factorial non deposit quid pro quo hic escorol. Marquee selectus non provisio incongruous feline nolo contendre Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum. </div> <div id='two' style="display:none;"> body two <input type='button' onclick="toggleBody('2')" /><br/> Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit� de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit� de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. </div> </body> </html>
Posts croisés ...
fais le toggle sur le display du td ou du tr pour conserver la bonne structure du tableau ...
ben ça donnerait ça :
NE PAS OUBLIER LE TR !!!!
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <body> <table border="3" width="628" height="100" cellpadding="0"> <tr> <td width="190" height="42" align="center" valign="middle"><a href="../../MODES.STM"><img border="0" src="robot.gif" width="147" height="147"></a></td> <td width="190" height="42" align="center" valign="middle"><a href="../../op10.STM"><img src="BPOP10.gif" width="120" height="42"></a><br> <br> <a href="../../op20.STM"><img src="BPOP20.gif" width="120" height="42"></a></td> <td id="specialtd" style="display:inline"> <td width="190" height="42" align="center" valign="middle"><a href="../../potence.STM"><img src="BPpot.gif" width="120" height="42"></a></td> </tr> </table> <input type="button" onclick="document.getElementById('specialtd').style.display=(document.getElementById('specialtd').style.display=='inline')?'none':'inline';" value="masquer/afficher" /> </body> </html>