我不知道为什么,但我的代码不起作用......
问题:iframe 不会调整大小。
我已经在网上搜索了解决方案,并且我在另一个域上有相同的代码,它可以工作......
编码:
<html>
<head>
<base target="_self">
<title>Montana Code Annotated - State Law</title>
<meta name="title" content="">
<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script type="text/javascript">
<!--
function resizeIframe(id){
/*
this.obj=obj
//this.obj.width=null
//this.obj.width=window.frames['sizeframe'].document.body.scrollWidth
this.obj.style.height='' // for Firefox and Opera
setTimeout('this.obj.style.height=this.obj.contentWindow.document.body.scrollHeight+(notIE?heightOffset:0)',10) // setTimeout required for Opera
*/
el=document.getElementById(id)
el.style.height="200px" // for Firefox and Opera
setTimeout("el.style.height=el.contentWindow.document.body.scrollHeight+'px'",1) // setTimeout required for Opera
}
// -->
</script>
</head>
<body topmargin="0" bottommargin="0"><div align="center">
<p><br>
</p>
<p>
<iframe name="windowoflaw" id="sizeframe" allowTransparency="true" onload="resizeIframe(this.id)" marginwidth="1" marginheight="1" height="200" width="800" scrolling="no" align="center" border="0" frameborder="0" src="http://leg.mt.gov/bills/mca_toc/">
</iframe></p>
</div>
</body>
</html>
-------------- 域名:montanacodeannotated.com