function SetWinHeight(obj)
{
var win=obj;
if (document.getElementById)
{
if (win && !window.opera)
{
if (win.contentDocument && win.contentDocument.body.offsetHeight)
win.height = win.contentDocument.body.offsetHeight;
else if(win.Document && win.Document.body.scrollHeight)
win.height = win.Document.body.scrollHeight;
}
}
}
<iframe width=”778″ align=”center” height=”200″ id=”win” name=”win” onload=”Javascript:SetWinHeight(this)” frameborder=”0″ scrolling=”no”></iframe>
本文介绍了如何使用JavaScript函数根据内容动态调整iframe的高度,确保页面布局的灵活性和响应性。
1452

被折叠的 条评论
为什么被折叠?



