Click to See Complete Forum and Search --> : Referencing Frame Attributes


Alan
02-16-2003, 06:13 PM
I've still not got the hang of frame refs so this is driving me mad trying different permutations.

In the Header frame there is a button with an onclick javascript to reference a function in the parent frame (brought in by Ops_Cen_Script_Control.js). That gets invoked OK.

I'm stuck trying to set the col attribute in the Left frame. I need to dynamically resize it to zero width so that the Right & RightHeader frames take up the whole width.

<HTML>
<HEAD>
<SCRIPT src="Ops_Cen_Script_Cookies.js";></SCRIPT>
<SCRIPT src="Ops_Cen_Script_Control.js";></SCRIPT>
<!-- Created with AOLpress/2.0 -->
<LINK REL=stylesheet HREF="Ops_Cen_Style_Guide.css" TYPE="text/css">
</HEAD>
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" ROWS="62,1*">
<FRAME SRC="Header.htm" NAME="Header" SCROLLING="No" NORESIZE>
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" COLS="50%,50%">
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" ROWS="100%,1,1*">
<FRAME SRC="blank.htm" NAME="Left" MARGINWIDTH="0" MARGINHEIGHT="0" NORESIZE>
<FRAME SRC="frmPage.htm" NAME="frmPageView" SCROLLING="No" NORESIZE>
<FRAME SRC="bldPage.htm" NAME="bldPageView" SCROLLING="No" NORESIZE>
</FRAMESET>
<FRAMESET ROWS="19%,83%">
<FRAME SRC="RightHeader.htm" NAME="RightHeader" SCROLLING="No" NORESIZE>
<FRAME SRC="blank.htm" NAME="Right" MARGINWIDTH="15" MARGINHEIGHT="15" NORESIZE>
</FRAMESET>
</FRAMESET>
</FRAMESET>

The script only needs to work under IE.

Thanks.
Alan
I'm new to this forum but it seems very active and helpful. Thanks a lot.

Alan
02-16-2003, 06:18 PM
Clarification!!

Its the
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" COLS="50%,50%">

that I want to change to
<FRAMESET FRAMEBORDER="0" FRAMESPACING="0" COLS="0%,100%">

It seems more logical to name the frameset and reference the col attribute on that, but I've never seen that coded anywhere.

Thanks
Alan

Alan
02-18-2003, 04:38 PM
My hunch was correct, the FRAMESET needs a NAME= and then the code is simplicity:

frames["framename"].setAttribute("cols","0%,*");

However, it is then important to force the browser to re-draw. I open an empty page into a small browser window:

window.open ("refresh.htm","","height=1,width=1");
}

The refresh.htm has an ONLOAD script to immediately close itself:

window.close();


Alan