Forum Moderators: open
What I want to do is have a script that looks at the location of the bottom frame and makes the whole page go that frame.
Can anyone help?
Leo Kent
First of all: Welcome to Webmaster World!
As for your question, here is one possible solution. This example assumes that you have a frameset html document and a separate html document that lives in the top frame of the frameset html document.
The top frame (topframe.htm) source:
<head>
<title>top frame source</title>
<script type="text/javascript">
<!--
//this function should be located in head of the html page which lives in the top frame.
//You will also need to give the bottom frame of your frameset html document an id (in this example I called the bottom frame bottomFrame
function closeFrames(){
//get source of bottomFrame from the parent frameset html document
var cURL=parent.document.getElementById('bottomFrame').src
//set the location of the parent window to cURL
parent.location=cURL
}
//-->
</head>
<body>
<button onclick="closeFrames()">close frame</button>
</body>
the frameset source from the frameset html page:
<frameset framespacing="0" border="true" frameborder="0" rows="50,*">
<frame name="topframe" scrolling="auto" target="_self" noresize src="topframe.htm" marginwidth="12" marginheight="16">
<frame id="bottomFrame" name="bottomFrame" scrolling="auto" target="_self" noresize src="http://yourbottomurlhere" marginwidth="12" marginheight="16" >
</frameset>
Hope this helps,
ajkimoto