iframe自适应高度
2015-12-16 17:37
323 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>iframe自适应高度</title> </head> <body> <div id="leamain"> <iframe src="#" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="765" height=100% id="iframepage" name="iframepage" onLoad="iFrameHeight()" ></iframe> </div> <script> 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; } } </script> </body> </html>
相关文章推荐
- android 友盟 用户反馈 自定义界面发图片问题
- MySQL中列子查询与行子查询操作的学习教程
- Canvas 的绘制图表的基本用法
- 1.6---旋转二维数组,旋转图像像素,旋转矩阵,90度(CC150)
- iOS真机调试报错 A valid provisioning profile for this executable was not found.
- 开启Instruments之旅吧
- 自定义View执行invalidate()方法
- 最最简单又实用的ftp安装以及使用
- [转] 深入探讨C++中的引用
- 1.5---字符串压缩(CC150)
- ios实现屏幕旋转的方法
- Qt学习笔记(QAction,QString格式化输出)
- oracle profile介绍
- PopupWindow 点击其他地方消失
- oracle ASM 初装
- 7个经典小故事给在职场困倦的你打打气
- 5. URN schema validation
- 跳转到应用市场代码片段
- Uncaught SyntaxError: Unexpected token < view1
- field 'int android.view.View.mViewFlags' on a null object reference