2 回答

TA貢獻1831條經驗 獲得超10個贊
你照我的做法試試:
1,
function SetCwinHeight(obj)
{
var cwin=obj;
if (document.getElementById)
{
if (cwin && !window.opera)
{
if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
cwin.height = cwin.contentDocument.body.offsetHeight;
else if(cwin.Document && cwin.Document.body.scrollHeight)
cwin.height = cwin.Document.body.scrollHeight;
}
}
}
2,在iframe里面加上
onload="Javascript:SetCwinHeight(this)"試試。

TA貢獻1802條經驗 獲得超5個贊
這樣絕對可以:
<body style="margin:0;padding:0;">
<div style="width:20%; height:20px; background-color:gray; float: left;"></div>
<iframe frameborder="0" src="http://baidu.com/" style="width:80%; height:120px; float: right;">
</body>
添加回答
舉報