Stefan: Navigation funktioniert unter Netscape nicht

Beitrag lesen

hallo,

habe eine navigation für meine page geschrieben. leider funktioniert diese nur im internet explorer, nicht aber im netscape. im netscape können die untermenues nicht geöffnet werden.

was muss ich ändern, definieren, damit meine navigation auch im netscape läuft?

hier mein code zur navigation:

<html> <head>   <style type="text/css">    a {color: #602B39; text-decoration: none;}    body{font-size: 8pt;color: black;font-family: Verdana}   </style> <script language="JavaScript">                 <!--

// Get browser type                 // Object "document.layers" only exists in Netscape Navigator                 if(document.layers)                 {                      ns = 1; ie = 0;                 }                 else                 {                      ns = 0; ie = 1;                 }

// Style Sheet for Netscape Communicator, tree items are positioned absolute.                 // Unlike Internet Explorer, attribute "visibility" is used to show                 // or hide tree items.                 if(ns)                 {                         document.write( "<style type='text/css'>" +                                                                 ".child { position:absolute; visibility:hidden; }" +                                                                 ".parent { position:absolute; visibility:show; }" +                                                         "</style>");                 }

// Style Sheet for Internet Explorer, tree items are positioned relative.                 // Unlike Netscape Communicator, attribute "display" is used to show                 // or hide tree items.                 if(ie)                 {                         document.write( "<style type='text/css'>" +                                                                 ".child { display:none; position:relative; }" +                                                                 ".parent { display:block; position:relative; }" +                                                         "</style>");                 }

//============================================================================                 // function NetscapeInit()                 //                 // Due to the relative positions of the tree items in Netscape Navigator,                 // each position has to be set before the first display.                 //============================================================================                 function NetscapeInit()                 {                         for(var iI=0 ; iI < document.layers.length; iI++)                         {                                 document.layers[iI+1].top = document.layers[iI].y                                 if (document.layers[iI].visibility == "show")                                 {                                         document.layers[iI+1].top += document.layers[iI].clip.height;                                 }                         }                 }

//============================================================================                 // function ExpandShrink()                 //                 // Shows or hides an item in the tree identified by iItem                 //                 // Numeration is as follows:                 //                 // parent(0)                 //   |                 //   +-- child(1)                 // parent(2)                 //   |                 //   +-- child(3)                 // ...                 //============================================================================                 function ExpandShrink(iItem)                 {                         if(ns)                         {                                 if(document.layers[iItem].visibility == "show")                                 {                                         for(var iI=iItem+1; iI<document.layers.length; iI++)                                         {                                                 document.layers[iI].top -= document.layers[iItem].clip.height;                                         }                                         document.layers[iItem].visibility = "hide";                                 }                                 else if(document.layers[iItem].visibility == "hide")                                 {                                         for(var iI=iItem+1; iI<document.layers.length; iI++)                                         {                                                 document.layers[iI].top += document.layers[iItem].clip.height;                                         }                                         document.layers[iItem].visibility = "show";                                 }                         }                         if(ie)                         {     switch (iItem)     {     case 3:     document.all["item"+6].style.display = "none";     document.all["item"+8].style.display = "none";      break;     case 5:     document.all["item"+4].style.display = "none";     document.all["item"+8].style.display = "none";      break;      case 7:     document.all["item"+4].style.display = "none";     document.all["item"+6].style.display = "none";      break;     }

if(document.all["item"+(iItem+1)].style.display == "none" || document.all["item"+(iItem+1)].style.display == "")                                 {                                         document.all["item"+(iItem+1)].style.display = "block";                                 }                                 else if(document.all["item"+(iItem+1)].style.display == "block")                                 {                                         document.all["item"+(iItem+1)].style.display = "none";                                 }                         }                 }

//-->                 </script>

</head>

<body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" topmargin="0" onLoad="if(ns) NetscapeInit()">   <table width="193" cellpadding="0" cellspacing="0" border="0" background="menubg.jpg">    <tr valign="top">     <td><img src="menutop.jpg" width="193" height="33" border="0" alt="">      <table width="193" cellpadding="15" cellspacing="0" border="0">       <tr valign="top">        <td>        <font face="Verdana"><div id="item1" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left">                                                      <a href="Startseite.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'"target="Daten">Home</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item2" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Annette.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">Annette</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item3" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td valign="center">                                                      <a href="javascript:ExpandShrink(3)" target="Navigation" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'">                                                              Stefan                                                      </a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item4" class="child">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left">                                                      <a href="Stefan.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Portrait</a>                                              </td>                                      </tr>          <tr>                                              <td align="left">                                                      <a href="Inline.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Inline</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item5" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td valign="center">                                                      <a href="javascript:ExpandShrink(5)" target="Navigation" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'">                                                              Foto Album                                                      </a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item6" class="child">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="1. August 2004/index.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;1. August 2004</a>                                              </td>                                      </tr>                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Zermatt/index.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Zermatt 11.04</a>                                              </td>                                      </tr>                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Lauberhorn/index.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Lauberhorn 05</a>                                              </td>                                      </tr>

<tr>                                              <td align="left">                                                      <a href="mägishütte/index.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Mägishütte 01.05</a>                                              </td>                                      </tr>                                      <tr>                                              <td align="left" valign="center">                                                      <a href="grossetto/index.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Grossetto 03.05</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item7" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="javascript:ExpandShrink(7)" target="Navigation" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'">                                                              Wedding                                                      </a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item8" class="child">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left">                                                      <a href="Dates.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Dates</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Lovestory.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Lovestory</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Location.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Location</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Accomodation.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Accomodation</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Directions.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Directions</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Witnesses.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Witnesses</a>                                              </td>                                       </tr>                                       <tr>                                              <td align="left" valign="center">                                                      <a href="Wish_liste.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">&nbsp;&nbsp;Wish liste</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item9" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Guestbook.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">Guestbook</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item10" class="parent">                              <table bor                              der="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Contact.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">Contact</a>                                              </td>                                      </tr>                              </table>                      </div>

<div id="item11" class="parent">                              <table border="0" cellpadding="0" cellspacing="0">                                      <tr>                                              <td align="left" valign="center">                                                      <a href="Link.html" onMouseOver="this.style.font='bold'" onMouseOut="this.style.font='normal'" target="Daten">Link</a>                                              </td>                                      </tr>                              </table>                      </div></font>        </td>       </tr>      </table>     <img src="menubottom.jpg" width="193" height="28" border="0" alt=""></td>    </tr>   </table> </body> </html>

danke für die hilfe. mfg stefan