Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>layer test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="some.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>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[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=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>
<div id="navig" class="1"> <a href="#" onClick="MM_showHideLayers('hidden1','','show')">
show hidden 1 </a>
<a href="#" onClick="MM_showHideLayers('hidden2','','show')">
show hidden 2 </a> </div>
<div id="visiblefrombegin" class="scrollbox">
this is from begining visible layer</div>
<div id="hidden1" class="2">here is firs hiden layer</div>
<div id="hidden2" class="2">here is second hiden layer</div>
</body>
</html>
****************************************************
problem:
layers shows as it meant to, but when I u click on second layer and its shows, u cant "call" firs layer eny more.. I can't figure out why?! But maybe you have a clue?
thanx in advance
carramba
[edited by: tedster at 7:07 pm (utc) on Aug. 13, 2003]
[edit reason] turn off graphic smile faces [/edit]
I'm a little biased, but check out this show-hide layer script [webmasterworld.com].
You may find it easier to work with...
HTH
So I agree with BlobFisk's "prejudice", do check out the link. I don't want MacroMedia being the "master" of my web, and you may enjoy being back in control of your own code as well.
[edited by: tedster at 7:14 pm (utc) on Aug. 13, 2003]