...

View Full Version : Frames



Ultragames
08-14-2005, 12:56 AM
I have 2 frames. I need to be able to click a button in one window, and have it change both.

Also, is it possible to have a mouse over in frame 2 run a script that changes something in frame 1?

Thanks.

Lerura
08-14-2005, 01:27 AM
if you want to load a new page in both frames
you can use this:

<input type="button" value="Click here" onClick="LoadNewPages()">
or
<a href="javascript:LoadNewPages()">Click here</a>

and the script for that is:

function LoadNewPages(){
parent.theotherframe.location.href="new.htm";
location.href="new.htm";
}

--------------------

if for example you want to change the backgroundcolor of the other page
you can use this:

<input type="button" value="Click here" onClick="ChangeBGcolor()">
or
<a href="javascript:ChangeBGcolor()">Click here</a>

and the script for that is:

function ChangeBGcolor(){
parent.theotherframe.document.bgcolor="FF0000";
}

ANEWIDEACo
08-14-2005, 10:08 AM
That should work...

I remember reading somthing about it at:

http://www.webmonkey.com

goto search and look up frames... :D

vwphillips
08-14-2005, 10:52 AM
Operate across frames in a frameset via the 'top' or 'parent'

therefor to change two frames


onclick="window.top.frame1.location='One.htm';window.top.frame2.location='Two.htm';"


where frame1 and frame2 are the frame names specified in the frameset



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum