Forum Moderators: open

Message Too Old, No Replies

How to change bgcolor in other frame?

         

Ribtin

12:15 am on Sep 26, 2004 (gmt 0)

10+ Year Member



I have site with 2 frames. When I click a link in the mainframe which loads up a new page there, with a different background color, I want the backround color in the 'menu' frame to change as well, to match the other one. Is this possible in a simple way, or must I create a whole new .htm with a different bgcolor?

adni18

2:44 am on Sep 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



no way! It is actually quite simple:

<script language=javascript>
function bgChange() {
window.parent.menu.document.bgcolor="blue"
}
</script>
<input type=button onClick="bgChange()">

Ribtin

3:22 am on Sep 26, 2004 (gmt 0)

10+ Year Member



I'm sorry, I can't get that to work. Would you please explain a little more? I'm really a noob...

Is there anything I need to change or add to the code you wrote, or can I just paste it?

Ribtin

4:03 am on Sep 26, 2004 (gmt 0)

10+ Year Member



never mind, I finally figured it out. =)