Roland KRysl: Bild (Layer)wechsel bei onmouseover

Beitrag lesen

Hallo zusammen,

mit einer einfachen Funktion sollen bei mousover und -out wechselnde Div-Bereiche erscheinen.
Ein Wechseln des Bildbereiches kommt nicht in Frage, weil die Bilder unterschiedlich groß
sind. Das Problem habe ich für den NN4.7 und den IE5 gelöst, nur beim Dom
hakts. Ich vermute, daß ich mitder Klammerung Probleme habe. Oder stimmt die Positionierung
der Divs nicht? In Selfhtml habe ich keine Lösung gedfunden, daher die Bitte um Hilfe.
Ist hier die Klammerung richtig, fehlen hier etwa Anführungszeichen, oder
was will der Mozilla?
p[i] ist das entsprechende Element des Arrays.

if ((document.getElementById) && (navigator.appName=="Netscape"))
 {
document.getElementById(p[i]).style.visibility='hidden';
document.getElementById(q[i]).style.visibility='visible';
    }

Vielen Dank im Voraus,

Roland Krysl

Hier ein funktionsfähiger Auszug aus dem Skript:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
 <title>Lay2b</title>
</head>

<body bgcolor="#EEBBBB">
<br>
<br>
<br>
<br>
<script language="JavaScript">
p = new Array("BrucknerEins","AromoEins","ZoardEins","MikkaEins","MamiEins",
"DomEins","LajosEins","LoszerEins","VacskaEins");
q = new Array("BrucknerZwei","AromoZwei","ZoardZwei","MikkaZwei","MamiZwei",
"DomZwei","LajosZwei","LoszerZwei","VacskaZwei");

function Zeigeneu(i)
{
if (document.all)
   {
document.all[p[i]].style.visibility='hidden';
document.all[q[i]].style.visibility='visible';
    }

if (document.layers)
   {
document[p[i]].visibility='hidden';
document[q[i]].visibility='visible';
   }

if ((document.getElementById) && (navigator.appName=="Netscape"))
 {
document.getElementById(p[i]).style.visibility='hidden';
document.getElementById(q[i]).style.visibility='visible';
    }

}

function Zeigealt(i)
{
if (document.all)

{
document.all[q[i]].style.visibility='hidden';
document.all[p[i]].style.visibility='visible';
   }

if (document.layers)
   {
document[q[i]].visibility='hidden';
document[p[i]].visibility='visible';
   }

if ((document.getElementById) && (navigator.appName=="Netscape"))
 {
document.getElementById(q[i]).style.visibility='visible';
document.getElementById(p[i]).style.visibility='hidden';
    }
}
</script>

<div id="BrucknerZwei" style="position:absolute; left:100px; top:10px; width:85; height:100;  visibility:visible" width:300px; height:250px; background-color:#DDDDFF; color:#000066;
font-family:Arial; font-size:9pt; font-weight:bold; padding:10px>
<a href onmouseover="javascript:Zeigealt(0)"><b><img src="szomor.jpg" border="none"></b></a>
</div>

<div id="BrucknerEins"
style="position:absolute; left:100; top:10; width:85; height:100; visibility:hidden" width:300px; height:250px; background-color:#DDDDFF; color:#000066;
font-family:Arial; font-size:9pt; font-weight:bold; padding:10px;>
<a href onmouseout="javascript:Zeigeneu(0)"><b><img src="bruckner.jpg" border="none"></b></a>
</div>

<div id="AromoZwei" style="position:absolute; left:189; top:30; width:70; height:63;  visibility:visible" width:300px; height:250px; background-color:#DDDDFF; color:#000066;
font-family:Arial; font-size:9pt; font-weight:bold; padding:10px;>
<a href onmouseover="javascript:Zeigealt(1)"><b><img src="arom2.gif" border="none"></b></a>
</div>

<div id="AromoEins"
style="position:absolute; left:187; top:30; width:70; height:63; visibility:hidden" width:300px; height:250px; background-color:#DDDDFF; color:#000066;
font-family:Arial; font-size:9pt; font-weight:bold; padding:10px;>
<a href onmouseout="javascript:Zeigeneu(1)"><b><img src="arom1.gif"  border="none"></b></a>
</div>

</body>
</html>