关于iframe背景色与网页背景色同步的问题

我在一个页面里放了一个iframe,想要求iframe背景色与网页背景色同步的(也就是让iframe的页面的背景色为透明)
---------------------------------------------------------------

 1<body bgcolor="#ABCDEF">
 2<iframe name="iframe1" src="tt.htm"></iframe>
 3<script language="javascript">   
 4setTimeout("document.iframe1.document.body.bgColor=document.body.bgColor", 100);   
 5</script>   
 6\---------------------------------------------------------------   
 7  
 8a.htm   
 9<script>   
10function setBG(){   
11var strColor=document.bgColor;   
12frm.document.bgColor=strColor;   
13}   
14</script>
15<body onload="setBG()" style="background-color:red">
16<iframe name="frm" src="about:blank"></iframe>   
17\---------------------------------------------------------------   
18  
19透明背景的开/关设置   
20  
21http://lucky.myrice.com/javascriptexam/mengxhtrans55.htm</body></body>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus