Forum Moderators: open

Message Too Old, No Replies

open layer in another frame...

how can u get a layer to appear in another frame evoked from another?

         

username here

1:18 pm on Jan 25, 2002 (gmt 0)



Can any1 hlp?

I wanna mouseover an image and then open a layer / <div> element in another frame.

yes that's right i'm making a drop down menu but need it to seem like it can cross frame boundaries...

any advice is appreciated....thx

joshie76

1:43 pm on Jan 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi username_here, welcome to WmW

lets say your right frame is called 'rightFrame' and you have a function in that frame that shows/hides the layer called showLayer(bool).

in the left frame you can call window.top.rightFrame.showLayer(true);

If you want the function in the left frame you can call it as normal but wherever you reference the layer in the right hand frame (by document.blahblah)
you need to use the same window pointer as above to get to the layer in the right, i.e. window.top.rightFrame.document.blahblah.

Hope that helps. If you need any elaboration just give us a shout.

Josh

username here

2:24 pm on Jan 28, 2002 (gmt 0)



yep that help. in fact it's exactly what i was looking 4...

thanx for the help. appreciate it.

fille

10:40 am on Mar 28, 2002 (gmt 0)



Similar problem!
The command comes from frame nr 4, and I wont to write every code in frame nr 4 and only have the layer/div visible in frame nr 6
If I referens to an object in frame 6 there wont bee any object there. Is there a nothere way?

All this in the same document.
--------------beginning nav.doc--------
...
layerRef="parent.frames[6].document.all"
//layerRef="document.all";
//window.top.rightframe.showlayer(true)//ns
styleSwitch=".style";
visibleVar="visible";
}
}
function showHideLayerSwitch(layerName)
{
if (eval (layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility == visibleVar'))
hideLayer(layerName);
else
showLayer(layerName);
}
function showLayer(layerName)
{
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}
....
document.writeln(" <div id="+i2+" ><ahref=\"javascript:showHideLayerSwitch('"+i2+y+"');\" style=\"…..position: absolute; z-index: "+not_hidden_z+"; left: "+not_hidden_left+"px; top: "+not_hidden_top+"px; \"> ¦ " + nav[i2][1] + "</a>");
….
document.writeln("<style type=text/css>");
document.writeln("#"+(i2-1)+y+" {position: absolute; z-index: "+hidden_z+"; visibility: hidden; left: "+hidden_left+"px; top: "+hidden_top+"px;}");
document.writeln("</style>");
document.writeln("<div id="+(i2-1)+y+">");
.....
---------end nav.doc-----------------