Ok, so I made an Iframe and there are buttons inside the Iframe that are supposed to change the backgroundcolor and the color of the font of outside the Iframe. How can I do that?
I already tried this:
parent.document.body.style.backgroundColor = "red";
parent.document.*.style.color = "blue";
HELP!!!
Koenie
Css, Javascript And Iframe Trouble
Page 1 of 12 Replies - 1490 Views - Last Post: 21 October 2002 - 01:16 AM
Replies To: Css, Javascript And Iframe Trouble
#2
Re: Css, Javascript And Iframe Trouble
Posted 20 October 2002 - 09:42 PM
I got it to work by changing the body's class, which could be cool because you can also change things like the font at the same time:
The main page:
The iFrame page:
The main page:
<html>
<head>
<title>Test Page</title>
<style>
.blue { background-color: blue; color: yellow;}
.red { background-color: red; color: white; }
</style>
</head>
<body bgcolor="#FFFFFF">
iFrame:<br>
<iframe src="iframe.htm" name="define" width="200" marginwidth="0" height="200" marginheight="0" scrolling="auto" frameborder="0">get a newer browser.</iframe>
</body>
</html>
The iFrame page:
<html> <head> <title>iFrame</title> </head> <body bgcolor="#FFFFFF"> <form> <input type="button" name="Blue" value="Blue" onclick="parent.document.body.className='blue'"> <input type="button" name="Red" value="Red" onclick="parent.document.body.className='red'"> </form> </body> </html>
#3
Re: Css, Javascript And Iframe Trouble
Posted 21 October 2002 - 01:16 AM
Ok, thanks, it's not exactly what I wanted, but now I can figure it all out easily!
Thanks, Koenie
Thanks, Koenie
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote



|