|
October 17, 2000 Promoting Child Frames Tips: October 2000
Yehuda Shiran, Ph.D.
|
|
When dealing with frames, you may not like your frame set to be displayed as a child frame in somebody else's frame set. You may not like the way it looks and feels, or it may function differently than what you had planned for. The remedy for this problem is to force the child frame set to become the top-level frame set. Just add the following script to the frame set file:
The script checks whether the current Let's take an example. This frame set has three child frames: a tall frame on the left hand side and two short frames on the right hand side, one at the top and one at the bottom. The right top frame is not a simple frame, though. it is a frame set that is identical to the top-level frame set, so all in all we have 5 frames. But, when adding the above script, the child frame set promotes itself to be the top level frame set, sporting only three frames.
Here is the content of the five-frame file,
And after adding the script above, we get the 3-frame file,
Here is the code for the child frames. First,
Then
And finally the third one: Learn more about frames in Column 36, Frames and JavaScript, Part I, and in Column37, Frames and JavaScript, Part II.
People who read this tip also read these tips: Look for similar tips by subject: |