星空网 > 软件开发 > Java

iFrame根据里面的内容给高度,

<iframe src='/images/loading.gif' data-original="member/membercenteraction" frameborder="0" scrolling="no" name="iframepage" width="100%" id="iframepage" onload="this.height=400"></iframe>

  

 

function iFrameHeight() {  var iframe = document.getElementById("iframepage");  var bHeight = iframe.contentWindow.document.body.scrollHeight;  var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;  var height = Math.max(bHeight, dHeight);  iframe.height = height;}window.setInterval("iFrameHeight()", 200);

不过我觉得这样效果并不好~~

 

 

<iframe src='/images/loading.gif' data-original="member/membercenteraction" frameborder="0" scrolling="no" name="iframepage" width="100%" id="iframepage" onload="iFrameHeight()"></iframe>

 

function iFrameHeight() {  var ifm= document.getElementById("iframepage");  var subWeb=window.frames["iframepage"]. contentDocument || window.frames["iframepage"]. contentWindow.document;  var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;  if(ifm != null && subWeb != null) {    ifm.height = subWeb.body.scrollHeight;  }}window.setInterval("iFrameHeight()", 200);

这种有的页面行,有的不行~搞不懂~~~

iFrame根据里面的内容给高度,




原标题:iFrame根据里面的内容给高度,

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

立即下架!热门侵权案件大起底,1000+店铺冻结危机抓紧避雷...:https://www.kjdsnews.com/a/1660026.html
TikTok近6个月广告受众数据,增长最快国家公布:https://www.kjdsnews.com/a/1660027.html
汉堡港董事会同意 MSC 收购协议:https://www.kjdsnews.com/a/1660028.html
热度飙升2500%,日售844单,老外爱上中国篝火盖:https://www.kjdsnews.com/a/1660029.html
12 款Top电子邮件营销软件:https://www.kjdsnews.com/a/1660030.html
收藏|亚马逊人不得不知道的合规事项:https://www.kjdsnews.com/a/1660031.html
船底顶攻略(船底顶最详细攻略):https://www.vstour.cn/a/411239.html
川藏线自驾游要怎么走才比较划算呢?:https://www.vstour.cn/a/411240.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流