Hallo,
Weiß jemand eine Lösung, wie ich einen solchen "Zustandswechsel" ganz ohne EventHandler und Javascript realisieren kann? Alle Lösungsvorschläge, die es ja in größerer Menge im Archiv gibt, setzen auf DHTML inclusive Javascript ...
Ohne JavaScript duerfte das im HTML|CSS-Kontext nicht machbar sein. Auch wenn es Dir wohl nicht direkt weiter hilft, hier das in SVG moegliche Vorgehen ohne eine Zeile Scriptcode:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="50" y="50" width="150" height="100" style="fill: #090; display: none">
<set attributeName="display" attributeType="CSS" to="block" begin="on.click"/>
<set attributeName="display" attributeType="CSS" to="none" begin="off.click"/>
</rect>
<rect x="50" y="50" width="150" height="100" style="fill: #F00; display: block">
<set attributeName="display" attributeType="CSS" to="none" begin="on.click"/>
<set attributeName="display" attributeType="CSS" to="block" begin="off.click"/>
</rect>
<a id="on" xlink:href=""><text x="70" y="200">grün -> on | rot -> off</text></a>
<a id="off" xlink:href=""><text x="70" y="230">rot -> on | grün -> off</text></a>
</svg>
Die beiden DIVs sind mal vereinfacht als Rechtecke simuliert [in SVG waere ein Analogon zu div das Element g (group)].
MfG, Thomas