声明:有更好的方法在下一篇内容中

100%

http://www.360doc.com/content/11/1102/15/55892_161105115.shtml

 

iframe自适应高度 转自:

http://www.cnblogs.com/Nbge/archive/2013/06/14/3135697.html

<iframe src="index.html" >>

 

<script type="text/javascript" language="javascript">  
function iFrameHeight() {  
var ifm= document.getElementById("iframepage");  
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;  
if(ifm != null && subWeb != null) {
   ifm.height = subWeb.body.scrollHeight;
   ifm.width = subWeb.body.scrollWidth;
}  
}  
</script>

 

相关文章:

  • 2021-10-10
  • 2021-06-30
  • 2021-08-07
猜你喜欢
  • 2021-12-12
  • 2021-12-12
  • 2021-12-12
  • 2021-11-16
  • 2021-06-17
相关资源
相似解决方案