iframe的高度是否可随内容的变化而变化 iframe的高度是否可随内容的变化而变化我设置的scrolling="no"是没有滚动条的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <iframe src="XXX.htm" width="700px" frameborder="0" id="frmsrc" scrolling="no" marginheight="0" onload="AutoIframe()"></iframe><script type="text/javascript"> function AutoIframe() { if(document.readyState!='complete') { setTimeout( function(){AutoIframe();},25 ); return; } else { var ifobj=document.getElementById("frmsrc"); ifobj.height= ifobj.contentWindow.document.body.scrollHeight; } }</script>//PS: XXX.htm不可跨域 <iframe src="dd.html" id="frmMain" name="frmMain" width="99%" height="100%" frameborder=0 scrolling=no marginHeight=0 marginWidth=0 onload="Javascript:SetWinHeight(this)" ></iframe>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; } }} 可以的,写个js让iframe自适应 把 width="100%" height="100%" asp.net关于ajax ASP。net TABLE 显示 使用回调功能 网站发布出现问题,求解 关于ajaxpro在虚拟空间出现'_Default'未定义的错误 请教,asp.net中如何用js脚本在运行过程中来改变页面上textbox的css风格? 数据库部署问题 请教表中ID自增问题。感谢 关于操作word时的权限设置问题 谁有.met的安装密匙啊?序列号,给我一个! 从数据库获取单条记录问题(速战速决,马上给分)! 搜索tab菜单
function AutoIframe()
{
if(document.readyState!='complete')
{
setTimeout( function(){AutoIframe();},25 );
return;
}
else
{
var ifobj=document.getElementById("frmsrc");
ifobj.height= ifobj.contentWindow.document.body.scrollHeight;
}
}
</script>//PS: XXX.htm不可跨域
{
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;
}
}
}