Web Analytics Made Easy -
StatCounter :: help with strange netscape bug :: - CodingForum

Announcement

Collapse
No announcement yet.

:: help with strange netscape bug ::

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • :: help with strange netscape bug ::

    ok i have a page like below.. where the 2 lines of bold text are commented out they seem to be screwing the navigation in NS4

    on my NS4 those 2 lines (which only actually stick the upper NAV in a positioned layer) seem to stop the navigation working when they are not commented out.. but works fine when they are in?!?

    /me is confused...





    ^^^ working and none working versions,,

    Code:
    <html>
    <head>
    <title>arraysubtest2</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    .display {
            visibility:hidden;
            background-color:#eeeeee;
            color:#333333;
            font-family:verdana;
            position:absolute;
            font-size:12px;
            width:600px; 
            left: 20px; 
            top: 100px;
    }
    
    .mainlinks {
    	position:absolute; 
    	width:770px; 
    	height:19px; 
    	z-index:1; 
    	left: 20px; 
    	top: 40px;
    }
    </style>
    
    <script language ="javascript" type="text/javascript">
    
    <!--
    function show(object) {
        if (document.getElementById && document.getElementById(object) != null)
             node = document.getElementById(object).style.visibility='visible';
        else if (document.layers && document.layers[object] != null)
            document.layers[object].visibility = 'visible';
        else if (document.all)
            document.all[object].style.visibility = 'visible';
    }
    
    function hide(object) {
        if (document.getElementById && document.getElementById(object) != null)
             node = document.getElementById(object).style.visibility='hidden';
        else if (document.layers && document.layers[object] != null)
            document.layers[object].visibility = 'hidden';
        else if (document.all)
             document.all[object].style.visibility = 'hidden';
    }
    //-->
    
    </script>
    
    <script language="JavaScript">
    <!--
    function MM_reloadPage(init) {  //Updated by PVII. Reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <body bgcolor="#FFFFFF">
    <script language ="javascript" type="text/javascript">
    function returnstatus() {
    (window.status='Welcome to the Simons Group');
    return true;
    }
    
    function hideall() {
    hide('Grouplayer'); 
    hide('Constructionlayer'); 
    hide('Estateslayer'); 
    hide('Blankerlayer'); 
    hide('Simonstogetherlayer'); 
    hide('Supplierslayer'); 
    hide('Linkslayer');
    hide('Searchlayer'); 
    hide('Helplayer');
    hide('Wrightslayer');
    hide('QDSlayer'); 
    hide('Designlayer'); }
    
    [b]//document.write('<div id="mainlinks" class="mainlinks">');[/b]
    linkRay = new Array()
    linkRay[0] = new Array("javascript:;","Group")
    linkRay[1] = new Array("javascript:;","Construction")
    linkRay[2] = new Array("javascript:;","Estates")
    linkRay[3] = new Array("http://www.simonsdesign.com\" target=\"blank","Design")
    linkRay[4] = new Array("http://www.wrights-construction.com\" target=\"blank","Wrights")
    linkRay[5] = new Array("http://www.qdsltd.com\" target=\"blank", "QDS")
    linkRay[6] = new Array("javascript:;","Simonstogether")
    linkRay[7] = new Array("javascript:;","Suppliers")
    linkRay[8] = new Array("javascript:;","Links")
    linkRay[9] = new Array("javascript:;","Search")
    linkRay[10] = new Array("javascript:;","Help")
    for (wrin=0;wrin<linkRay.length;wrin++) {
    document.write('<a href=\"'+linkRay[wrin][0]+'\" onClick="hideall(); show(\''+linkRay[wrin][1]+'layer\');\" onMouseout=\"document.'+linkRay[wrin][1]+'name.src=\'images/'+linkRay[wrin][1]+'img0.gif\'; returnstatus();\" onMouseOver=\"document.'+linkRay[wrin][1]+'name.src=\'images/'+linkRay[wrin][1]+'img1.gif\'; (window.status=\''+linkRay[wrin][1]+'\'); return true;\"><img name=\"'+linkRay[wrin][1]+'name\" src=\"images/'+linkRay[wrin][1]+'img0.gif\" border=\"0\" alt=\"'+linkRay[wrin][1]+'\" title=\"'+linkRay[wrin][1]+'\"></a>');
    }
    [b]//document.write('</div>');[/b]
    </script>
    
    <div id="Constructionlayer" class="display">const</div>
    <div id="Estateslayer" class="display">estates</div>
    <div id="Blankerlayer" class="display">blanker</div>
    <div id="Simonstogetherlayer" class="display">simonstogether</div>
    <div id="Supplierslayer" class="display">suppliers</div>
    <div id="Linkslayer" class="display">links</div>
    <div id="Searchlayer" class="display">search</div>
    <div id="Helplayer" class="display">help</div>
    <div id="Designlayer" class="display">design</div>
    <div id="Wrightslayer" class="display">wrights</div>
    <div id="QDSlayer" class="display">qds</div>
    
    <script language ="javascript" type="text/javascript">
    groupRay = new Array()
    groupRay[0] = new Array("http://www.simonsdesign.com\" target=\"blank", "Welcome", "Welcome to Simons testing 1 2 3", "Group")
    groupRay[1] = new Array("http://www.simonsdesign.com\" target=\"blank", "Missionstatement", "Mission statement", "Group")
    groupRay[2] = new Array("http://www.simonsdesign.com\" target=\"blank", "Structure", "Group structure", "Group")
    groupRay[3] = new Array("http://www.simonsdesign.com\" target=\"blank", "Workingforsimons", "Working for Simons", "Group")
    groupRay[4] = new Array("http://www.simonsdesign.com\" target=\"blank", "Awards", "Awards", "Group")
    groupRay[5] = new Array("http://www.simonsdesign.com\" target=\"blank", "Financial", "Financial", "Group")
    groupRay[6] = new Array("http://www.simonsdesign.com\" target=\"blank", "Environmental", "Environmental", "Group")
    groupRay[7] = new Array("http://www.simonsdesign.com\" target=\"blank", "Locationmap", "Location map", "Group")
    groupRay[8] = new Array("http://www.simonsdesign.com\" target=\"blank", "Contact", "Contact us", "Group")
    groupRay[9] = new Array("http://www.simonsdesign.com\" target=\"blank", "Downloads", "Downloads", "Group")
    groupRay[10] = new Array("http://www.simonsdesign.com\" target=\"blank", "Articles", "News articles about the Group", "Group")
    groupRay[11] = new Array("http://www.simonsdesign.com\" target=\"blank", "Projects", "Project files", "Group")
    var linkstart = ('<div id="'+groupRay[wrin][3]+'layer" class="display"><table width="758" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td>');
    document.write(linkstart);
    for (wrin=0;wrin<groupRay.length;wrin++) {
    var sublinks = ('<a href=\"'+groupRay[wrin][0]+'\" onMouseout=\"document.'+groupRay[wrin][1]+'name.src=\'images/subs/'+groupRay[wrin][1]+'img0.gif\';  document.'+groupRay[wrin][3]+'name.src=\'images/'+groupRay[wrin][3]+'img0.gif\'; returnstatus();\" onMouseOver=\"document.'+groupRay[wrin][1]+'name.src=\'images/subs/'+groupRay[wrin][1]+'img1.gif\'; document.'+groupRay[wrin][3]+'name.src=\'images/'+groupRay[wrin][3]+'img1.gif\'; (window.status=\''+groupRay[wrin][2]+'\'); return true; \"><img name=\"'+groupRay[wrin][1]+'name\" src=\"images/subs/'+groupRay[wrin][1]+'img0.gif\" border=\"0\" alt=\"'+groupRay[wrin][2]+'\" title=\"'+groupRay[wrin][2]+'\"></a>')
    document.write(sublinks);
    }
    document.write('</td></tr></table></div>');
    </script>
    
    </BODY>
    </HTML>
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

  • #2
    I don't think this

    document.layers[object].visibility = 'hidden';


    is valid syntax. I never used <DIV> for layers in ns4 because <layer> is more powerful, so I don't know if it uses a different syntax for its properties. For a <layer> you would need

    document.layers[object].visibility = "hide";

    and "show"

    If the <DIV> method uses style, then presumably it would be

    document.layers[object].style.visibility = "hidden";
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

    Comment


    • #3
      hmmz - tried that with no effect

      it just seems wierd that the scripts work until i stick the top navbar in a div (which work fine in NS 4 btw ) why the hell should this affect anything?
      "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

      Comment


      • #4
        Well you know ... with netscape 4 the answer usually turns out to be "because"
        "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

        Comment


        • #5
          Hi

          Aside from the fact i would not rely on NN4 to handle properly layers which are dinamically written, anyway you can do 2 things to accomodate it:

          1) layers must be soon after the body tag: NN4 can do very very strange things if layers are not listed soon after the body tag: nothing in between.
          2) when you write to the document, do not mix scripts with html to write! And put the script which writes under the body tag.
          <script> js statememtns...</script>

          <body>
          <script>document.write(stuff); document.close()</script>

          As you may notice, the last script tag goes after body, and holds only the writing commands, ending with a close() document command.
          This would help out the elusive mr NN4...

          ciao
          Last edited by TrueLies; Jun 28, 2002, 12:30 AM.
          Alberto http://www.unitedscripters.com/

          Comment

          Working...
          X