I have a simple frames page in which a frame called 'topframe' creates a new window. I would like the new window to be able to access functions from the calling frames.
In this case, frame name 'topframe' creates a new window and inserts new.htm in it. I would like new.htm to change the color of the frame named 'left'. I just can't get the heiarchy correct.
See the ChangeColor() function in the last script
Thanks Doug
mainframe.htm -
<HTML>
<head>
</head>
<FRAMESET frame="pframe" COLS="15%,15%,*">
<FRAME SRC="left.htm" name="left">
<frameset name="cframe" rows="50%,*">
<FRAME SRC="top.htm" name="topframe">
<FRAME SRC="bottom.htm" name="bottom">
</FRAMESET>
<FRAME SRC="right.htm" name="right">
</FRAMESET>
top.htm -
<HTML>
<body>
<script type="text/javascript" language="javascript">
function CheckTheme(theme)
{
QueryWindow = window.open("new.htm"
}
</script>
<body>
<a href="javascript:CheckTheme();">New Window</a>
</BODY>
</HTML>
new.htm
<HTML>
<head>
</head>
<script type="text/javascript" language="javascript">
function ChangeColor()
{
parent.parent.left.document.bgColor="violet"// <--
}
</script>
<body>
<a href="javascript:CheckTheme();">Violet Calling window</a>
</body>
</html>
In this case, frame name 'topframe' creates a new window and inserts new.htm in it. I would like new.htm to change the color of the frame named 'left'. I just can't get the heiarchy correct.
See the ChangeColor() function in the last script
Thanks Doug
mainframe.htm -
<HTML>
<head>
</head>
<FRAMESET frame="pframe" COLS="15%,15%,*">
<FRAME SRC="left.htm" name="left">
<frameset name="cframe" rows="50%,*">
<FRAME SRC="top.htm" name="topframe">
<FRAME SRC="bottom.htm" name="bottom">
</FRAMESET>
<FRAME SRC="right.htm" name="right">
</FRAMESET>
top.htm -
<HTML>
<body>
<script type="text/javascript" language="javascript">
function CheckTheme(theme)
{
QueryWindow = window.open("new.htm"
}
</script>
<body>
<a href="javascript:CheckTheme();">New Window</a>
</BODY>
</HTML>
new.htm
<HTML>
<head>
</head>
<script type="text/javascript" language="javascript">
function ChangeColor()
{
parent.parent.left.document.bgColor="violet"// <--
}
</script>
<body>
<a href="javascript:CheckTheme();">Violet Calling window</a>
</body>
</html>