var Sys={};
var ua=navigator.userAgent.toLowerCase();
var s;
(s=ua.match(/msie ([\d.]+)/))?Sys.ie=s[1]:
(s=ua.match(/firefox\/([\d.]+)/))?Sys.firefox=s[1]:
(s=ua.match(/chrome\/([\d.]+)/))?Sys.chrome=s[1]:
(s=ua.match(/opera.([\d.]+)/))?Sys.opera=s[1]:
(s=ua.match(/version\/([\d.]+).*safari/))?Sys.safari=s[1]:0;
var pTar=null;
pTar=document.getElementById(down);
eval(‘pTar=’+down+’;’);
}
pTar.style.display=”block”;
pTar.height=pTar.contentWindow.document.body.offsetHeight+15+”px”;
pTar.width=pTar.contentWindow.document.body.scrollWidth+”px”;
pTar.height=pTar.Document.body.offsetHeight+15+”px”;
pTar.width=pTar.Document.body.scrollWidth+”px”;
pTar.height=pTar.Document.body.scrollHeight+25+”px”;
pTar.width=pTar.Document.body.scrollWidth+”px”;
}
}
pTar.height=pTar.contentDocument.body.offsetHeight+15+”px”;
pTar.width=pTar.contentDocument.body.scrollWidth+”px”;
}
pTar.height=pTar.contentDocument.body.offsetHeight;
pTar.width=pTar.contentDocument.body.scrollWidth;
}
pTar.height=pTar.contentDocument.body.offsetHeight;
pTar.width=pTar.contentDocument.body.scrollWidth;
}
pTar.height=pTar.contentDocument.body.offsetHeight+10;
pTar.height=pTar.contentDocument.body.offsetHeight;
}
pTar.width=pTar.contentDocument.body.scrollWidth;
}
}
具体的使用方法如下(设置id=phpernote的iframe的高度自适应iframe里面的内容高度):
style=”border:0px;background:#FFF;max-height:245px;
” scrolling=”no” src=”http://www.phpernote.com/comm/page/″ id=”phpernote” οnlοad=”javascript:dyniframesize(‘phpernote’);”>
上篇文章我们介绍了如何使用iframe属性,这篇文章也依然教大家iframe自适应高度的解决办法,希望两篇文章让你对iframe标签有一个更深入的了解。
今天的文章 iframe自适应高度_html页面自适应分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/139327.html