1<table align="center" border="0" cellpadding="0" cellspacing="0">
2<tr>
3<td align="center" bgcolor="#FFFFFF" valign="bottom" width="100%">
4<iframe frameborder="0" name="PlayFrm" scrolling="auto" src="1.htm" style="Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; height:100%"></iframe>
5</td>
6</tr>
7</table>
我的意思能不能让iframe的宽度和高度(也即table的宽度和高度)跟着1.htm的宽度和高度来变化
---------------------------------------------------------------
关于iframe的动态大小变化的问题 放在被iframe的页里.
1<script language="javascript"><!--
2function window.onload()
3{
4if (self.location != top.location)
5{
6parent.document.all(self.name).height = document.body.scrollHeight + 20;
7parent.document.all(self.name).width = document.body.scrollWidth + 20;
8}
9}
10// --></script>
---------------------------------------------------------------
1<html>
2<head>
3<script language="javascript">
4<!--
5function test(){
6var w=PlayFrm.document.body.scrollWidth;
7var h=PlayFrm.document.body.scrollHeight;
8document.all.PlayFrm.style.width=w+20;
9document.all.PlayFrm.style.height=h+20;
10}
11//-->
12</script>
13</head>
14<body onload="test()">
15<table align="center" border="0" cellpadding="0" cellspacing="0">
16<tr>
17<td align="center" bgcolor="#FFFFFF" valign="bottom" width="100%">
18<iframe frameborder="0" name="PlayFrm" scrolling="auto" src="3.asp" style="Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; height:100%"></iframe>
19</td>
20</tr>
21</table>
22</body></html>