Hallo Thollsten,
<img src="minus.gif" id="minus_det1" onclick="collapse(det1)">
<img src="plus.gif" id="plus_det1" onclick="expand(det1)">
Hmm. Das muss IMHO so heißen:
<img src="minus.gif" id="minus_det1" onclick="collapse('det1');" alt="-">
<img src="plus.gif" id="plus_det1" onclick="expand('det1');" alt="+">
Javascript:
function expand(id) {
eval(id+".style.display='inline'");
eval("plus_"+id+".style.display='none'");
eval("minus_"+id+".style.display='inline'");
}
Merksatz: Eval is evil.
Schlussfolgerung:
function expand(id) {
document.getElementById(id).style.display = 'inline';
document.getElementById('plus_'+id).style.display = 'none';
document.getElementById('minus_'+id).style.display = 'inline';
}
Das gilt für die andere Funktion natürlich entsprechend.
Schreibe deinen Code auf diese Art und Weise um, führe deinen Code erneut aus und schicke uns das Ergebnis.
Grüße
Marc Reichelt || http://www.marcreichelt.de/
--
Linux is like a wigwam - no windows, no gates and an Apache inside!
Selfcode: ie:{ fl:| br:> va:} ls:< fo:} rl:( n4:( ss:) de:> js:| ch:? sh:| mo:) zu:)
http://emmanuel.dammerer.at/selfcode.html
Linux is like a wigwam - no windows, no gates and an Apache inside!
Selfcode: ie:{ fl:| br:> va:} ls:< fo:} rl:( n4:( ss:) de:> js:| ch:? sh:| mo:) zu:)
http://emmanuel.dammerer.at/selfcode.html