Griever: Warum geht das nicht?

Beitrag lesen

Hi.

Ich habe mir mal was kleines geschrieben. Aber das was ich versuchten wollte, geht nicht mal ansatzweise. (Wird nur im IE 4.x^ genutzt!!!)

<body>
<script language="JavaScript">
<!--
document.write("<style>\n"+
               "a.Menue_Item div {cursor:default;text-decoration:none;}\n"+
               "a.Menue_Item div div {background-color:white;}\n"+
               "a.Menue_Item:hover div div {background-color:black;}\n"+
               "</style>")
obj = (document.getElementById("SDG_Menue"))?"SDG_2_Menue":"SDG_Menue";document.write("<span id=""+obj+""></span>")
function init()
{
}
var hoehe = 18
function GColor(r,g,b) {
 r = 255-((r>255)?255:(r<0)?0:r)
 g = 255-((g>255)?255:(g<0)?0:g)
 b = 255-((b>255)?255:(b<0)?0:b)
 var rr = (r<16)?"0":"",rb = (b<16)?"0":"",rg = (g<16)?"0":"";
 this.Color = String("#"+rr+r.toString(16)+""+rb+b.toString(16)+""+rg+g.toString(16)).toUpperCase()
}
function Color(r,g,b) {
 var rr = (r<16)?"0":"",rb = (b<16)?"0":"",rg = (g<16)?"0":"";
 r = (r>255)?255:(r<0)?0:r
 g = (g>255)?255:(g<0)?0:g
 b = (b>255)?255:(b<0)?0:b
 // Sorry, wenn die Zeilen zu lang sind
 this.Color = String("#"+rr+r.toString(16)+""+rb+b.toString(16)+""+rg+g.toString(16)).toUpperCase()
 this.LeftOb = "<a href="#" class="Menue_Item" style="border:0px;"><div style="margin-top:1px;display:inline;overflow:hidden;height:"+hoehe+"px;width:10px;cursor:default;border:1px solid "+this.Color+";background-color:"+this.Color+";"><div style="height:100%;overflow:hidden;cursor:default;display:inline;width:4px;">&nbsp;</div></div>"
 var gegenfarbe = new GColor(r,g,b)
 this.Val = "<div style="color:"+gegenfarbe.Color+";margin-top:1px;text-vertical-align:top;display:inline;overflow:hidden;height:"+hoehe+"px;width:180px;cursor:default;border:1px solid "+this.Color+";background-color:"+this.Color+";">("+this.Color+"/"+r+","+b+","+g+") "
 this.Val2 = "</div>"
 this.RightOb = "<div style="text-align:right;display:inline;margin-top:1px;overflow:hidden;height:"+hoehe+"px;width:10px;border:1px solid "+this.Color+";cursor:default;background-color:"+this.Color+";"><div style="height:100%;overflow:hidden;cursor:default;display:inline;width:4px;">&nbsp;</div></div></a>"
}
var StrG = "235,221,231"
var testfarbe
testfarbe = eval("new Color("+StrG+")")
document.write(testfarbe.LeftOb)
document.write(testfarbe.Val + "Home"+testfarbe.Val2)
document.write(testfarbe.RightOb+"<br>")
testfarbe = eval("new Color("+StrG+")")
document.write(testfarbe.LeftOb)
document.write(testfarbe.Val + "Seite 1"+testfarbe.Val2)
document.write(testfarbe.RightOb+"<br>")
testfarbe = eval("new Color("+StrG+")")
document.write(testfarbe.LeftOb)
document.write(testfarbe.Val + "Seite 2"+testfarbe.Val2)
document.write(testfarbe.RightOb+"<br>")

function Menue() {
  this.a = 0
  this.b = new Object()
  this.b.a = 0
  this.b.b = 2
  this.b.c = 2
}

var Items = new Menue()

document.body.onload = init
-->
</script>
</body>

Kann mir einer sagen, warum trotz der Style-Angabe die Items nicht verändert werden?

Link funktioniert. Doch Hover und so nicht.

Was ist da falsch?