Für eine Menüsteuerung habe ich fogendes Skript zusammengeschustert.
Muss dabei ziemlich viele Fälle abfragen und irgendwie scheitert es an der Stelle nach der ersten If-Abfrage. Browser sagt mir in Zeile 3 würde ein ; fehlen ?????????
Hier das Skript:
function init_move(wlayer){
If (ams==wlayer){
switch (wlayer){
case "top1":
move ('bottom1',125,25);
move ('top2',225,125);
move ('top3',250,150);
ams="";
break;
case "top2":
move ('bottom2',150,50);
move ('top3',250,150);
ams="";
break;
case "top3":
move ('bottom3',175,75);
ams="";
break;
}
}
else
{
switch (wlayer){
case "top1":
document.all.bottom1.style.zIndex = "3";
document.all.bottom2.style.zIndex = "2";
document.all.bottom3.style.zIndex = "1";
hide(bottom2);
hide(bottom1);
move ('top3',150,250);
move ('top2',125,225);
move ('bottom1',25,125);
ams="top1";
break;
case "top2":
document.all.bottom1.style.zIndex = "2";
document.all.bottom2.style.zIndex = "3";
document.all.bottom3.style.zIndex = "1";
hide(bottom2);
hide(bottom1);
move ('top3',150,250);
move ('bottom2',50,150);
ams="top2";
break;
case "top3":
document.all.bottom1.style.zIndex = "1";
document.all.bottom2.style.zIndex = "2";
document.all.bottom3.style.zIndex = "3";
hide(bottom2);
hide(bottom1);
move ('bottom3',75,175);
ams="top3";
break;
}
}
Noch was zu den Variablen: ams ist ein string, genauso wie wlayer und werden ausserhalb als globale Variable (zu Beginn leer) deklariert.
Schönen Dank für die Hilfe
Bastian