function SetCwinHeight()
{
var cwin=document.getElementById("cwin");
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;
  }
 }
}
<iframe width="778" align="center" height="200" id="cwin" name="cwin" onload="Javascript:SetCwinHeight(this)" frameborder="0" scrolling="no"></iframe>

关于iframe的高度自适应问题(js)的更多相关文章

  1. 跨域iframe的高度自适应

    If you cannot hear the sound of the genuine in you, you will all of your life spend your days on the ...

  2. iframe的高度自适应

    http://www.cnblogs.com/snandy/p/3902337.html http://www.cnblogs.com/snandy/p/3900016.html Snandy Sto ...

  3. 同域iframe的高度自适应

    引子 父页面里控制子页面 子页面里控制父页面 一.引子 我们先看一个示例,有两个页面,1.html通过iframe嵌入2.html,两个页面都是同域的 1.html <!DOCTYPE html ...

  4. JQuery iframe宽高度自适应浏览器窗口大小的解决方法

    iframe宽高度自适应浏览器窗口大小的解决方法   by:授客 QQ:1033553122 1.   测试环境 JQuery-3.2.1.min.js 下载地址: https://gitee.com ...

  5. js获取iframe和父级之间元素,方法、属,获取iframe的高度自适应iframe高度

    摘自:http://blog.csdn.net/kongjiea/article/details/38870399 1.在父页面 获取iframe子页面的元素 (在同域的情况下 且在http://下测 ...

  6. Iframe 高度自适应,js控制Iframe 高度自适应

     Iframe 高度自适应, js控制Iframe 高度自适应, iframe自适应高度 ================================ ©Copyright 蕃薯耀 2019年12 ...

  7. 实现iframe窗口高度自适应的又一个巧妙思路

    domainA 中有一个页面index.html,通过iframe嵌套了domainB中的一个页面other.html由于other.html页面在iframe中显示,而且其页面内容会动态的增加或减少 ...

  8. 让动态的 iframe 内容高度自适应

    使用iframe加载其他页面的时候,需要自适应iframe的高度 这里加载了两个不同内容高度的页面至iframe中 1. 没有设置高度 <div class="iframe-wrapp ...

  9. Jquery-处理iframe的高度自适应

    超级简单的方法,也不用写什么判断浏览器高度.宽度啥的.下面的两种方法自选其一就行了.一个是放在和iframe同页面的,一个是放在test.html页面的.注意别放错地方了哦. iframe代码,注意要 ...

随机推荐

  1. Block层也是有IO的优先级的

    ---恢复内容开始--- 今天查看iotop的原理,竟然发现了IO优先级一说,IO是block层cfs调度器中的概念 block层也有一个类似于CPU的调度算法 对进程分成三个级别:RT,BE,IDL ...

  2. js获取页面元素位置函数(跨浏览器)

    function getElementPos(elementId) { var ua = navigator.userAgent.toLowerCase(); var isOpera = (ua.in ...

  3. weex 开发 (已放弃了)

    关于weex 开发 本菜已放弃使用了,当初选择使用weex 是为了同时支持h5 和 android / ios  三端:想法很不错,深入之后 突然发现,开发起来并没有很轻松,因为weex 中有些方法, ...

  4. Java 命令行编译项目

    如果是用Exlipse, 第三方的包可以放在eclipse文件夹的jre包的lib文件夹中! (初学者的一些总结-高手们勿喷哈-) 原因: 以前一直用Eclispe编程环境运行Java.非常舒服,就像 ...

  5. 洛谷 P3573 [POI2014]RAJ-Rally 解题报告

    P3573 [POI2014]RAJ-Rally 题意: 给定一个\(N\)个点\(M\)条边的有向无环图,每条边长度都是\(1\). 请找到一个点,使得删掉这个点后剩余的图中的最长路径最短. 输入输 ...

  6. PL/SQL 查询结果集直接修改数据

    使用t.rowid,查询可以直接在查询结果中修改提交 SELECT t.rowid,t.* from  UC_ROLE t where ROLE_NAME like '% %'

  7. echarts移动端字体模糊解决方法

    echarts使用canvas画图,在移动端使用rem时候,若viewport的scale被缩放,则字体会发生模糊,本人采用的解决方法是在不同的dpr下使用不同的字体大小,具体代码如下: 获取字体大小 ...

  8. 染色 color

    染色 color 题目描述 有一块矩阵平板,分成n*m个格子,一开始全是白色.在这上面进行k次染色,每次染色按照如下步骤:1. 随机选择一个格子,称为A.2. 随机选择一个格子,称为B.3. 将由A ...

  9. Disable or enable the IPv6 protocol in Red Hat Enterprise Linux

    Resolution Red Hat Enterprise Linux 4, 5 and 6 enable Internet Protocol Version 6 (IPv6) by default. ...

  10. Lesson9 some interesting things in C#

    1.关键帧动画 1)xml 界面 <Page x:Class="Test.MainPage" xmlns="http://schemas.microsoft.com ...