Hi Leute,
Nach stundenlangem Suchen und Probieren hoffe ich hier Rat zu finden.
Ich habe vor Jahren eine Seite gemacht, deren Navigation von Mozilla nicht gelesen wird. Nun möchte ich das Script umschreiben, aber es gelingt mir einfach nicht.
Folgender Code im HEAD:
<!-- Navigation-->
<style type="text/css">
a.m { font: 11pt arial; color: white; text-decoration: none }
a:active.m { color: yellow; text-decoration: none; }
a:hover.m { color: yellow; text-decoration: none; }
a.subw { font: 11pt arial; color: white; text-decoration: none }
a:active.subw { color: yellow; text-decoration: none; }
a:hover.subw { color: white; text-decoration: none; }
a.subp { font: 11pt arial; color: white; text-decoration: none }
a:active.subp { color: yellow; text-decoration: none; }
a:hover.subp { color: white; text-decoration: none; }
a.subm { font: 11pt arial; color: white; text-decoration: none }
a:active.subm { color: yellow; text-decoration: none; }
a:hover.subm { color: white; text-decoration: none; }
a.subf { font: 11pt arial; color: white; text-decoration: none }
a:active.subf { color: yellow; text-decoration: none; }
a:hover.subf { color: white; text-decoration: none; }
a.sube { font: 11pt arial; color: white; text-decoration: none }
a:active.sube { color: yellow; text-decoration: none; }
a:hover.sube { color: white; text-decoration: none; }
a.subs { font: 11pt arial; color: white; text-decoration: none }
a:active.subs { color: yellow; text-decoration: none; }
a:hover.subs { color: white; text-decoration: none; }
#box {
position:absolute;
visibility:hidden;
}
#iebox {background-color:#D25A78 }
#iebox1 {background-color:#4B96C3 }
#iebox2 {background-color:#6FB42A }
#iebox3 {background-color:#BA9E4E }
#iebox4 {background-color:#FF9701 }
#iebox5 {background-color:#9966CC }
#iebox6 {background-color:green }
</style>
<script language="JavaScript">
<!--
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;
function DHTML_init() {
// wenn er das W3C-Modell kennt (Mozilla, IE ab 5) bekommt DOM den Wert 1
if(document.getElementById) {
DOM = 1;
}
// wenn er ein IE ist, bekommt MS den Wert 1
if(document.all && !OP) {
MS = 1;
}
// wenn er ein Netscape 4 ist bekommt NS den Wert 1
if (window.netscape && window.screen && !DOM && !OP){
NS = 1;
}
}
DHTML_init();
function openIt(x) {
var items = 44
for (i=0; i<=items; i++) {
if(MS = 1) {
document.all.box[i].style.visibility = "hidden";
document.all.box[x].style.visibility = "visible";
document.all.box[x].style.top = "31";
}
else if(DOM = 1) {
document.getElementById("box")[i].style.visibility = "hidden";
document.getElementById("box")[x].style.visibility = "visible";
document.getElementById("box")[x].style.top = "31";
}
else if(NS = 1) {
document.layers[i].visibility = "hide";
document.layers[x].visibility = "show";
document.layers[x].top="32";
}
}
}
function subDrop(y) {
var items = 45
for (i=7; i<items; i++) {
if(MS = 1){
document.all.box[i].style.visibility = "hidden";
document.all.box[y].style.top = "54";
document.all.box[y].style.visibility = "visible";
}
else if(DOM = 1){
document.getElementById("box")[i].style.visibility = "hidden";
document.getElementById("box")[y].style.top = "54";
document.getElementById("box")[y].style.visibility = "visible";
}
else if(NS = 1){
document.layers[i].visibility = "hide";
document.layers[y].top = "54";
document.layers[y].visibility = "show";
}
}
}
//-->
</script>
Hier ein Textausschnitt im Body - die Hauptleiste der Navigation:
<table border="1" cellpadding="1" cellspacing="1" width="100%" bgcolor="#008000" height="26" bordercolor="#FFFFFF">
<tr>
<td align="center" nowrap valign="middle" onClick="this.style.backgroundColor='green'" ><a class=m href="Nav2.htm" onClick= "openIt(0);document.bgColor='#FFFFCC'">Suche</a></td>
<td align="center" nowrap valign="middle" onClick="this.style.backgroundColor='#D25A78'" ><a class=m href="leerrosa.htm" onClick= "openIt(1);document.bgColor='#FEF1F5'"><B><FONT FACE="Verdana, Arial">Wirtschaft </FONT></B></a><img border="0" src="arrowdn.gif" width="13" height="13">
</td>
<td align="center" nowrap valign="middle" onClick="this.style.backgroundColor='#4B96C3'" >
<a class=m href="leerblau.htm" onClick="openIt(2);document.bgColor='#F1F5FA'"><B><FONT FACE="Verdana, Arial">Psychologie</FONT></B></a> <img border="0" src="arrowdn.gif" width="13" height="13">
</td>
----------->>>> usw. bis "openIt(6)
und weiter ein Textausschnitt - die 2. Ebene der Navigation:
<!-- Menu Bar Search -->
<div id=box style=left:3%>
<table id=iebox6 border="1" cellpadding="2" cellspacing="0">
<tr>
<td onMouseover="this.style.backgroundColor='green'"onMouseout="this.style.backgroundColor=''"><a class=subw href="search.htm">Durchsuchen der ganzen Web-Site</a></td>
<td onMouseover="this.style.backgroundColor='green'"onMouseout="this.style.backgroundColor=''"><a class=subw href="sitemap.htm">Site Map</a></td>
</tr>
</table>
</div>
<!-- Menu Bar Wirtschaft -->
<div id=box style=left:2%>
<table id=iebox border="1" cellpadding="2" cellspacing="0">
<tr>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href='leerrosa.htm' onClick="subDrop(7);"> Allgemein </a><img border="0" src="arrowdn.gif" width="10" height="10"></td>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href='leerrosa.htm' onClick="subDrop(8)"> Geschichte </a><img border="0" src="arrowdn.gif" width="10" height="10"></td>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href='leerrosa.htm' onClick="subDrop(9)"> Praxis </a><img border="0" src="arrowdn.gif" width="10" height="10"></td>
</tr>
</table>
</div>
--------->>>>>> usw. durch die ganze 2. Ebene.
Die 3. Ebene dann so - Textausschnitt:
<!--************** Sub Menu WIRTSCHAFT ******************-->
<!--************** Sub Menu W Allgemein ******************-->
<div id=box style=left:4% >
<table id=iebox border="1" cellpadding="2" cellspacing="0" >
<tr>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href="seite1.htm">Seite 1</A></td>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href="seite2.htm">Seite 2</A></td>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href="seite3.htm">Seite 3</A></td>
</tr>
</table>
</div>
<!--****************** Sub Menu W Geschichte **************************-->
<div id=box style=left:14% >
<table id=iebox border="1" cellpadding="2" cellspacing="0" >
<tr>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href="seite4.htm">Seite 4</A></td>
<td onMouseover="this.style.backgroundColor='#ec7796'"onMouseout="this.style.backgroundColor=''"><a class=subw href="seite5.htm">Seite 5</A></td>
</tr>
</table>
</div>
usw.
------>>>>> Im Internet Explorer und Netscape 4.x funktioniert alles. Aber der Mozilla will nicht.
Jede Idee ist willkommen
Hoffe, dass mir jemand helfen kann - vielen Dank im Voraus!
Chacharon