如果不用Iframe自动调整高度没有任何问题,但是加上自动调整高度的代码后,mht文档中的图片就无法显示了。
请高人指点!!!
自动调整高度代码如下:
<script language="javascript" type="text/javascript">
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;
}
}
}</script>
引用:
<iframe src="/WI/PSG/CHINA/NB/2010625105659.mht" frameborder="0" scrolling="Auto" width="100%" height="100%" id="cwin" name="cwin" onload="Javascript:SetCwinHeight(this)"></iframe>
请高人指点!!!
自动调整高度代码如下:
<script language="javascript" type="text/javascript">
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;
}
}
}</script>
引用:
<iframe src="/WI/PSG/CHINA/NB/2010625105659.mht" frameborder="0" scrolling="Auto" width="100%" height="100%" id="cwin" name="cwin" onload="Javascript:SetCwinHeight(this)"></iframe>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货