iframe自适应大小
2016-04-26 21:23
369 查看
<pre name="code" class="javascript"><pre name="code" class="html"><iframe id="iframe1" name="iframe1" frameborder="0" width="100%" scrolling="no" onLoad="iFrameHeight()"></iframe>
function iFrameHeight() { var ifm= document.getElementById("iframe1"); var subWeb = document.frames ? document.frames["iframe1"].document : ifm.contentDocument; if(ifm != null && subWeb != null) { ifm.height = subWeb.body.scrollHeight; ifm.width = subWeb.body.scrollWidth;
} };
相关文章推荐
- JavaScript Array(数组)
- Android Studio out of memory
- C++实现栈
- linux进程通信:消息队列
- 第6次作业
- 作业6 团队作业 阶段1
- 使用YCSB对HBase进行压测
- nyoj 16 矩形嵌套 (DAG上的动态规划)
- 如何打开.war文件
- 剑指offer:数组中出现次数超过一半的数字
- 数据结构之链表的增删操作的Java实现
- matlab——eemd函数的使用
- 递归
- no matching key exchange method found
- dialog调用dismiss函数异常
- python 列表、元组、字典 增删改查 等常用操作
- 上下文 —— ServletConfig、ServletContext
- C++中的Lambda表达式
- 编译型语言和解释型语言的区别
- 数学的那些事