ZeitGeist
Lounge-Member
ich habe folgendes script das im ie 6., opera ab 7.23, netscape 7 mozilla 1.8, firefox .9 fehlerfrei funktioniert, netscape 6.1 wird allerdings abgeschossen (kanns selber nicht testen da ich es noch nicht geschafft habe den zu installieren)
im Funktions aufruf werden die id des MainLinks und ein boolsche wert übergeben.
Die Funktion setzt als erstes alle Tabellen die in der großen Tabellen sind auf unsichtbar. falls check true ist gibts zu dem MainLink Sublinks. Diese Sublinks werden zeile für zeile zu erst unsichtbar gestzt. (SubTable bekommt per id die jeweilige Tabelle zugewiesen und mit SubTable.getElementsByTagName("tr").className wird jede Zeile unsichtbar gemacht. Danach wird die Tabelle sichtbar gemacht und dann mit der Funktion RollOut Zeile für Zeile wieder sichtbar gemacht.
wie gesagt tut das skript einwandfrei in den oben genannten browseren. nur in opera 7.11 wird wohl nur der letzte link dargestellt und netscape 6 hängt sich wohl auf (konnte beides nicht testen, da ich neuere browserversionen verwende).
hat irgendwer ne idee woran das liegen könnte, oder noch besser wie ich das script hinkriege das es überall läuft?
achja in action kann man das hier sehen www.radicarl.de/juhus
PHP:
function LinkWechsel(file, id, check)
{
parent.Inhalt.location.href = file;
for (var i = 1; i < document.getElementsByTagName("table").length; i++)
{
document.getElementsByTagName("table")[i].className = "unsicht";
}
if (check)
{
SubTable = document.getElementById("SubTable_"+ id);
for (var i = 0; i < SubTable.getElementsByTagName("tr").length; i++)
{
SubTable.getElementsByTagName("tr")[i].className = "unsicht";
}
document.getElementById("SubTable_"+ id).className = "sicht";
RollOut(SubTable, 0);
}
}
function RollOut(SubTable, i)
{
if (i < SubTable.getElementsByTagName("tr").length)
{
SubTable.getElementsByTagName("tr")[i].className = "sicht";
i++;
window.setTimeout('RollOut(SubTable,'+ i +')', 75);
}
}
HTML:
<table border="0" cellspacing="10" width="200px">
<!-- MAINLINK: Home !-->
<tr>
<td class="mainLinkZelle" >
<div title="Home" onClick="LinkWechsel('home.html', this.id, true)" class="mainLink" id="1" onMouseOver="Hover(this.id, true)" onMouseOut="Hover(this.id, false)">
<span> Home </span></div>
<!-- SUBLINKS -->
<table border="0" class="unsicht" id="SubTable_1">
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="sämtliche News von uns "id="SubBox_1_1" onClick="parent.Inhalt.location.href = 'home_news'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = home_news" title="sämtliche News von uns" class="subText" id="SubText_1_1" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">News</a></td>
</tr>
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="unsere Termine "id="SubBox_1_2" onClick="parent.Inhalt.location.href = 'home_termine'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = home_termine" title="unsere Termine" class="subText" id="SubText_1_2" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">Termine</a></td>
</tr>
</table>
</td>
</tr>
<!-- MAINLINK: JGL-Ausbildung !-->
<tr>
<td class="mainLinkZelle">
<div title="Jugendgruppenleiter Ausbildung" onClick="LinkWechsel('jgl-ausbildung.html', this.id, false)" class="mainLink" id="2" onMouseOver="Hover(this.id, true)" onMouseOut="Hover(this.id, false)">
<span> JGL-Ausbildung </span></div>
</td>
</tr>
<!-- MAINLINK: Otterndorf !-->
<tr>
<td class="mainLinkZelle" >
<div title="Feriencamp Otterndorf" onClick="LinkWechsel('otterndorf.html', this.id, true)" class="mainLink" id="3" onMouseOver="Hover(this.id, true)" onMouseOut="Hover(this.id, false)">
<span> Otterndorf </span></div>
<!-- SUBLINKS -->
<table border="0" class="unsicht" id="SubTable_3">
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="Link 1 "id="SubBox_3_1" onClick="parent.Inhalt.location.href = 'otterndorf_link1'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = otterndorf_link1" title="Link 1" class="subText" id="SubText_3_1" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">Link 1</a></td>
</tr>
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="Link 2 "id="SubBox_3_2" onClick="parent.Inhalt.location.href = 'klndsfkshgj2'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = klndsfkshgj2" title="Link 2" class="subText" id="SubText_3_2" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">Link 2</a></td>
</tr>
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="Link 3 "id="SubBox_3_3" onClick="parent.Inhalt.location.href = '3'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = 3" title="Link 3" class="subText" id="SubText_3_3" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">Link 3</a></td>
</tr>
<tr class="unsicht">
<td class="subBox">
<div class="subBox" title="Link 4 "id="SubBox_3_4" onClick="parent.Inhalt.location.href = 'klndsfkshgj'" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)"></div></td>
<td><a href="javascript:parent.Inhalt.location.href = klndsfkshgj" title="Link 4" class="subText" id="SubText_3_4" onMouseOver="HoverSub(this.id, true)" onMouseOut="HoverSub(this.id, false)">Link 4</a></td>
</tr>
</table>
</td>
</tr>
</table>
im Funktions aufruf werden die id des MainLinks und ein boolsche wert übergeben.
Die Funktion setzt als erstes alle Tabellen die in der großen Tabellen sind auf unsichtbar. falls check true ist gibts zu dem MainLink Sublinks. Diese Sublinks werden zeile für zeile zu erst unsichtbar gestzt. (SubTable bekommt per id die jeweilige Tabelle zugewiesen und mit SubTable.getElementsByTagName("tr").className wird jede Zeile unsichtbar gemacht. Danach wird die Tabelle sichtbar gemacht und dann mit der Funktion RollOut Zeile für Zeile wieder sichtbar gemacht.
wie gesagt tut das skript einwandfrei in den oben genannten browseren. nur in opera 7.11 wird wohl nur der letzte link dargestellt und netscape 6 hängt sich wohl auf (konnte beides nicht testen, da ich neuere browserversionen verwende).
hat irgendwer ne idee woran das liegen könnte, oder noch besser wie ich das script hinkriege das es überall läuft?
achja in action kann man das hier sehen www.radicarl.de/juhus
Zuletzt bearbeitet: