js实现自动调整大小的iframe
<IFRAME width="20%" name="test1" οnlοad="document.all('test1').style.height=test1.document.body.scrollHeight;" src="1.htm" frameborder= "0" scrolling="no"></IFRAME>
iframe自动调整大小
<script>
var myI,myW,myH
function ResizeIframe(i) {
i.height = 10;
i.width = 10;
var b = i.contentWindow.document.body;
myI = i;
myW = b.scrollWidth;
myH = b.scrollHeight;
setTimeout("ResizeIframe2(myI,myW,myH)",100);
}
function ResizeIframe2(i,w,h) {
i.height = h;
i.width = w;
}
</script>
<iframe name="I1" width="10" height="10" src="開啟網頁路徑" οnlοad="ResizeIframe(this)"></iframe>