Link to home
Start Free TrialLog in
Avatar of CRISIL
CRISIL

asked on

Iframes visibility in Netscape 6

Hi everyone -

   I am using the foll iframe code in my application.

<iframe name='ifrm1' id='ifrm1' src="newsearchpagedoc" frameborder='no' style="BORDER-RIGHT: #d3d4ed thin solid; BORDER-TOP: #d3d4ed thin solid; VISIBILITY:visible; BORDER-LEFT: #d3d4ed thin solid; BORDER-BOTTOM: #d3d4ed thin solid"  width=550 scrolling=yes height=200> </iframe>
<iframe name='ifrm2' id='ifrm2'  src="newsearchpagedata" frameborder='no' style="BORDER-RIGHT: #d3d4ed thin solid; BORDER-TOP: #d3d4ed thin solid; VISIBILITY:hidden; BORDER-LEFT: #d3d4ed thin solid; BORDER-BOTTOM: #d3d4ed thin solid"  width=0 scrolling=yes height=0></iframe>

The code is supposed to show the first frame by default and I have a javascript that toggles the two w.r.t to images provided above them. This code works completely fine in IE, but in Netscape 6 when I load the page for the first time, I see the contents of the hidden iframe.However when I refresh that frame manually the actual content comes up. Further the url shown for the iframe is also correct.

Please suggest what could be going wrong.
                              
Ritu
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Width and height of zero are invalid.  You need to give them a value of 1.  The invalid specification could be causing it.  Try that change and if it solves it we get away lucky with an easy fix.

Cd&
Avatar of GrandSchtroumpf
GrandSchtroumpf

It could be a bug in Netscape 6.
Netscape 6 is not used very much because it has lots of bugs.
Does it work in Netscape 7 and Firefox?
Supporting Netscape 7 should be enough.
Avatar of CRISIL

ASKER

Hi -

   I tried removing the width and height and also tested it in Netscape 7, the problem persists. Any other suggestions....?

Ritu
Let's sett the whole page.  Post a link or the page code, obviously there is something wrong with the page, not just the iframe.

Cd&
I agree with Cd&, we need the complete page.
Avatar of CRISIL

ASKER

Hi - I am pasting the html page here...pls help

<head>
<title></title>
<link rel="STYLESHEET" type="text/css" href="../cm/coolmenus.css">
<link rel="stylesheet" href="../cm/StyleSheet.css" type="text/css">
<script type="text/javascript" src="../cm/calendar1.js"></script>
</head>
<body onload = "changeCursor('Normal')" onunload="changeCursor('Wait')" bgcolor="#FFFFFF" background="../images/Topside1.jpg" Topmargin=0 Leftmargin=0 Marginheight=0 Marginwidth=0 >
<script language='javascript'>



function switchSrc(tomode)
      {
            var browserVer=navigator.appName;

            if(tomode=="D")
            {
                  if(browserVer=="Microsoft Internet Explorer")
                  {
                  document.all.ifrm2.style.visibility='hidden';
                  document.all.ifrm2.style.borderRight='';
                  document.all.ifrm2.style.borderLeft='';
                  document.all.ifrm2.style.borderTop='';
                  document.all.ifrm2.style.borderBottom='';
                  document.all.ifrm2.style.width=0;
                  document.all.ifrm2.style.height=0;

                  document.all.img1.src='../images/DocumentsSelected.jpg';

                  document.all.ifrm1.style.visibility='visible';
                  document.all.ifrm1.style.width=550;
                  document.all.ifrm1.style.height=200;
                  document.all.ifrm1.style.borderRight='#d3d4ed thin solid';
                  document.all.ifrm1.style.borderLeft='#d3d4ed thin solid';
                  document.all.ifrm1.style.borderTop='#d3d4ed thin solid';
                  document.all.ifrm1.style.borderBottom='#d3d4ed thin solid';

                  document.all.img2.src='../images/DataDeSelected.jpg';
                  }

                  if(browserVer=="Netscape")
                  {
                  document.getElementById("ifrm2").style.visibility='hidden';
                  document.getElementById("ifrm2").style.borderRight='';
                  document.getElementById("ifrm2").style.borderLeft='';
                  document.getElementById("ifrm2").style.borderTop='';
                  document.getElementById("ifrm2").style.borderBottom='';
                  document.getElementById("ifrm2").style.width=0;
                  document.getElementById("ifrm2").style.height=0;

                  document.getElementById("img1").src='../images/DocumentsSelected.jpg';

                  document.getElementById("ifrm1").style.visibility='visible';
                  document.getElementById("ifrm1").style.width=550;
                  document.getElementById("ifrm1").style.height=200;
                  document.getElementById("ifrm1").style.borderRight='#d3d4ed thin solid';
                  document.getElementById("ifrm1").style.borderLeft='#d3d4ed thin solid';
                  document.getElementById("ifrm1").style.borderTop='#d3d4ed thin solid';
                  document.getElementById("ifrm1").style.borderBottom='#d3d4ed thin solid';

                  document.getElementById("img2").src='../images/DataDeSelected.jpg';
                  }
            }
            else if(tomode=="T")
            {
                  if(browserVer=="Microsoft Internet Explorer")
                  {
                  document.all.ifrm1.style.visibility='hidden';
                  document.all.ifrm1.style.borderRight='';
                  document.all.ifrm1.style.borderLeft='';
                  document.all.ifrm1.style.borderTop='';
                  document.all.ifrm1.style.borderBottom='';
                  document.all.ifrm1.style.width=0;
                  document.all.ifrm1.style.height=0;

                  document.all.img1.src='../images/DocumentsDeselected.jpg';

                  document.all.ifrm2.style.visibility='visible';
                  document.all.ifrm2.style.width=550;
                  document.all.ifrm2.style.height=200;
                  document.all.ifrm2.style.borderRight='#d3d4ed thin solid';
                  document.all.ifrm2.style.borderLeft='#d3d4ed thin solid';
                  document.all.ifrm2.style.borderTop='#d3d4ed thin solid';
                  document.all.ifrm2.style.borderBottom='#d3d4ed thin solid';

                  document.all.img2.src='../images/DataSelected.jpg';
            }

                  if(browserVer=="Netscape")
                  {
                  document.getElementById("ifrm1").style.visibility='hidden';
                  document.getElementById("ifrm1").style.borderRight='';
                  document.getElementById("ifrm1").style.borderLeft='';
                  document.getElementById("ifrm1").style.borderTop='';
                  document.getElementById("ifrm1").style.borderBottom='';
                  document.getElementById("ifrm1").style.width=0;
                  document.getElementById("ifrm1").style.height=0;

                  document.getElementById("img1").src='../images/DocumentsDeselected.jpg';

                  document.getElementById("ifrm2").style.visibility='visible';
                  document.getElementById("ifrm2").style.width=550;
                  document.getElementById("ifrm2").style.height=200;
                  document.getElementById("ifrm2").style.borderRight='#d3d4ed thin solid';
                  document.getElementById("ifrm2").style.borderLeft='#d3d4ed thin solid';
                  document.getElementById("ifrm2").style.borderTop='#d3d4ed thin solid';
                  document.getElementById("ifrm2").style.borderBottom='#d3d4ed

thin solid';

                  document.getElementById("img2").src='../images/DataSelected.jpg';
                  }
            }
      }


</script>


<table width="100%" border=0 cellpadding=0 cellspacing=0>
                        <tr>
                              <td width="8%" align=center><a style='cursor:hand' onclick='javascript:switchSrc("D")'><img id=img1 src='../images/DocumentsSelected.jpg' border=0></a></td>
                              <td width="8%" align=center><a style='cursor:hand' onclick='javascript:switchSrc("T")'><img id=img2  src='../images/DataDeSelected.jpg' border=0></a></td>
                              <td>&nbsp;</td>
                        </tr>
                        <tr>
                              <td colspan=3>
                                    &nbsp;<iframe name='ifrm1' id='ifrm1' src="newsearchpagedoc" frameborder='no' style="BORDER-RIGHT: #d3d4ed thin solid; BORDER-TOP: #d3d4ed thin solid; VISIBILITY:visible; BORDER-LEFT: #d3d4ed thin solid; BORDER-BOTTOM: #d3d4ed thin solid"  width=550 scrolling=yes height=200> </iframe>
                                    <iframe name='ifrm2' id='ifrm2'  src="newsearchpagedata" frameborder='no' style="BORDER-RIGHT: #d3d4ed thin solid; BORDER-TOP: #d3d4ed thin solid; VISIBILITY:hidden; BORDER-LEFT: #d3d4ed thin solid; BORDER-BOTTOM: #d3d4ed thin solid"  width=1 scrolling=yes height=1></iframe>
                              </td>
                        </tr>
            </table>


</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial