Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem of Child Layer in Netscape 4.7

Status
Not open for further replies.

ketankshah

IS-IT--Management
Jan 11, 2001
121
IN
I am facing a peculiar problem in Netscape. I am sending you my script. The problem is when I have 2 hidden layers along with one child layer in each, it is showing 2nd layer as visible instead of hidden and the position is also not as per the requirement. To check the script, please replace the image name to which ever you are using in line 35. I have mapped the image in two areas to test the mouseover effect to make the layer visible.

The logic I want is when the page is loaded both the layers should be hidden. On mouse over on first mapping area, Layer 1 should be visible and on mouseover on second mapping area, Layer 2 should be visible. The problem is only when I put a child layer in each of the parent layer.

Please help.

The script
----------

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(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);
// -->

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>
<img src=&quot;images/becomemember1.gif&quot; width=&quot;105&quot; height=&quot;27&quot; border=&quot;0&quot; usemap=&quot;#Map&quot;>
<map name=&quot;Map&quot;>
<area shape=&quot;rect&quot; coords=&quot;52,5,100,24&quot; href=&quot;#&quot; onMouseOver=&quot;MM_showHideLayers('Layer1','','show')&quot; onMouseOut=&quot;MM_showHideLayers('Layer1','','hide')&quot;>
<area shape=&quot;rect&quot; coords=&quot;1,8,45,23&quot; href=&quot;#&quot; onMouseOver=&quot;MM_showHideLayers('Layer2','','show')&quot; onMouseOut=&quot;MM_showHideLayers('Layer2','','hide')&quot;>
</map>
<span id=&quot;Layer1&quot; style=&quot;position:absolute; width:120px; height:50px; z-index:1; left: 127px; top: 64px; background-color: #66FF99; layer-background-color: #66FF99; border: 1px none #000000; visibility: hidden&quot;>
<span id=&quot;Layer6&quot; style=&quot;position:absolute; width:91px; height:22px; z-index:7; left: 20px; top: 25px; visibility: inherit&quot;>Child
Layer 1</span> Layer 1</span>
<div id=&quot;Layer2&quot; style=&quot;position:absolute; width:134px; height:55px; z-index:2; left: 249px; top: 47px; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000; visibility: hidden&quot;>
<span id=&quot;Layer7&quot; style=&quot;position:absolute; width:96px; height:18px; z-index:7; left: 20px; top: 31px; visibility: inherit&quot;>Child
Layer2</span> Layer 2</div>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top