Hallo zusammen,
vielleicht kann mir jemand helfen: Ich habe 8 Bilder, bei Klick darauf erscheint jeweils (toggle) ein relativ langer Text dazu.
Wonach ich suche: Ein Text ist geöffnet - bei Klick auf ein beliebiges anderes bild (nicht nach Reihenfolge) soll Text a verschwinden und an der gleichen Stelle Text b erscheinen. Im Moment krige ich sie nur alle gleichzeitig nebeneinander oder untereinander hin. Die Tabelle kann dann auch weg. falls sie irgendwie stört.
Danke vorab!
hier der Code:
<p><script type="text/javascript"> function toggle(control) { var obj=document.getElementById(control); if (obj.style.display=='none') { obj.style.display = 'block'; } else if (obj.style.display=='block') { obj.style.display = 'none'; } } </script></p>
<table><colgroup>
<col width="25%" />
<col width="25%" />
<col width="25%" />
<col width="25%" /></colgroup>
<tr>
<td>
<div style=" padding: 4px; color: #fff; background-color: #92d400; display: none;" id="test1">1 Text Nummer 1 kommt hier ... Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.</div>
</td>
<td>
<div style=" padding: 2px; color: #fff; background-color: #002776; display: none;" id="test2">2 Und hier steht Text Nummer 2 ... At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit ametnvidunt ut labore et doloreet finitas lubarum.</div>
</td>
<td>
<div style=" padding: 2px; color: #fff; background-color: #72c7e7; display: none;" id="test3">3 Text Nummer 3 kommt hier ... Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam.</div>
</td>
<td>
<div style=" padding: 2px; color: #fff; background-color: #3c8a2e; display: none;" id="test4">4 Text Nummer 4kommt hier ... Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</div>
</td>
</tr>
<tr>
<td><a href="javascript:toggle('test1')">*<img style=" float: right;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_1.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=52865dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test2')">*<img style=" float: left;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_2.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=07875dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test3')">*<img style=" float: right;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_3.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=eb175dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test4')">*<img style=" float: left;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_4.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=52865dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
</tr>
<tr>
<td><a href="javascript:toggle('test5')">*<img style=" float: right;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_2.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=07875dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test6')">*<img style=" float: left;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_3.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=eb175dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test7')">*<img style=" float: right;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_4.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=07875dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
<td><a href="javascript:toggle('test8')">*<img style=" float: left;" src="/assets/Dcom-Germany/Local Assets/Images/01_Consulting/2012/jscript/Tile_1.png" alt="" name="vgn_ext_templ_rewrite?vgnextoid=eb175dad527e8310VgnVCM3000001c56f00aSTFL&vgnextstaticfile=1&vgnextmgmtpath=/assets/vgn_ext_templ_rewrite" /></a></td>
</tr>
</table>
<div style=" color: #ffffff; background-color: #00a1de; align=top; margin-left: 30px; display: none;" id="test5">5 Und hier steht Text Nummer 5 ctus est Lorem ipsum dolor sit amet. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>
<div style=" display: none;" id="test6">6 Text Nummer 6 kommt hier ... Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</div>
<div style=" display: none;" id="test7">7 Text Nummer 7 kommt hier ... Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</div>
<div style=" display: none;" id="test8">8 Text Nummer 8 kommt hier ... Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</div>