solairis.com

Change Multiple Frames With One Link

This script will open up 2 or more frames with one click of a link (I made an example based on this page).

Note: I do not endorse the use of this script. Frames are no longer desirable to the user. There are better ways to do this these days. JQuery, I'm sure, can accomplish this task much much better. This is kept up for historical purposes and for those that have to deal with older browsers.

// You need at least 2 frames to make this work
// (regular or iframes will do). Name one frame
// "frame1" and the other "frame2"
// (eg. <frame name="frame1" ... />).

// Of course, you'll need 2 files. name one
// file "blah.html" and the other "blahblah.html".
// Next, you need a link for "blah.html" and
// target it to "frame1"
// (eg. <a href="blah.html" target="frame1">).

// Now, with all of that out of the way...the
// fun stuff!

// Place this script in the <head> of "blah.html":

<script language="javascript" type="text/javascript">
var lem = (self.innerHeight != null    self.innerHeight == 0);
if ((parent.frame2==null || parent.frame2!='elfpower')    !lem) {
	 parent.frame2.location.replace('blahblah.html');
}
</script>

// And place this script in the <head> of "blahblah.html":

<script language="javascript" type="text/javascript">
	var le='elfpower';
</script>

That should do it! Now you're on your way to 2-frames-with-1-link fun! If there's any problems at all feel free to contact me.

Rate the Open 2 frames with 1 link at ScriptSearch.com!