Changing Two Frames at Once w/Nesting
Suppose we want to change two frames at one time. Basically, we will use a frameset, instead of a frame, as the target. Below we see Frames4.htm, on the left; compare this with the Frames4a.htm, on the right.
<HTML>
<FRAMESET COLS="20%, *">
<FRAME SRC="toc.htm" NAME="toc">
<FRAMESET ROWS="15%, *">
<FRAME SRC="buttons.htm" NAME="tlbar">
<FRAME SRC="ch1.htm" NAME="main">
</FRAMESET >
</FRAMESET >
</HTML>
|
|
<HTML>
<FRAMESET COLS="20%, *">
<FRAME SRC="toc2.htm" NAME="toc">
<FRAME SRC="double.htm" NAME="double">
</FRAMESET >
</HTML>
|
| Example 4 = "frames4.htm" |
| Example 4a = "frames4a.htm"
|
|---|
| calls 3 separate frames | | calls 2 separate frames
|
The result looks the same. Example 4 calls three frames using a nested frameset, the left column containing toc.htm and the right column containing the frameset calling both buttons.htm and ch1.htm. Example 4a calls for 2 frames with the right frame calling double.htm which itself will call two separate frames.
<HTML>
<FRAMESET ROWS="15%, 85%">
<FRAME SRC="buttons.htm" NAME="tlbar">
<FRAME SRC="ch1.htm" NAME="main">
</FRAMESET >
</HTML>
Double.htm
<BODY>
<A HREF="ch1.htm" TARGET="main">
<H2>Chapter 1</H2>>/A>
<A HREF="ch2.htm" TARGET="main">
<H2>Chapter 2</H2></A>
<A HREF="ch3.htm" TARGET="main">
<H2>Chapter 3</H2>>/A>
<A HREF="ch4.htm" TARGET="main">
<H2>Chapter 4</H2></A>
<A HREF="double2.htm" TARGET="double">
<H2>Chapter 5</H2></A>
</BODY>
toc2.htm
| |
Double.htm, on the left, supplies the two frames in the right column! Now look at the toc2.htm file that we'll have in our left frame.
The chapter 1,2,3 and 4 links all use "main" as the target. The story window is named (by double.htm) as "main". The chapter 5 link, however, targets "double" (named in frame4a.htm above) which is the full right column. So double2.htm, called by the chapter 5 link, opens a new frameset with two new frames to replace the frame named double.
Examine, on your own, the contents of double2.htm to see what files it calls. I also leave it to you to examine buttons2.htm to see how clicking on "1-4" will bring us back to the original configuration of the example 4 file.
