zoukankan      html  css  js  c++  java
  • iframe自适应高度js

     1 <iframe src="http://www.fufuok.com/" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="iFrameHeight()" ></iframe>Javascript代码: 
     2 <script type="text/javascript" language="javascript"> 
     3 function iFrameHeight() { 
     4 var ifm= document.getElementById("iframepage"); 
     5 var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument; 
     6 if(ifm != null && subWeb != null) { 
     7 ifm.height = subWeb.body.scrollHeight; 
     8 } 
     9 } 
    10 </script> 
  • 相关阅读:
    Day6
    Day6
    Day6
    Day6
    Day6
    Day6
    LeetCode "The Skyline Problem"
    HackerRank
    HackerRank
    HackerRank
  • 原文地址:https://www.cnblogs.com/mrcln/p/3917233.html
Copyright © 2011-2022 走看看