Iframe自适应高度
来源:互联网 发布:php输出100以内的素数 编辑:程序博客网 时间:2024/06/01 09:42
$(window.parent.document).find("#ContentIframe").load(function() { var main = $(window.parent.document).find("#ContentIframe"); var thisheight = $(document).height(); if (thisheight < 800) thisheight = 800; main.height(thisheight); });
这种写法,只能对于加载的时候对固有元素的自适应高度,当元素变化的时候(如添加了很多元素,高度变化后)不能及时改变父窗体的iframe高度。
function setMainHeight() { var main = $(window.parent.document).find("#ContentIframe"); var thisheight = $("body").height(); if (thisheight < 800) { thisheight = 800; } main.height(thisheight+50); setTimeout(setMainHeight, 2000);}
添加一个计时器,轮询判断子页面的高度变化。
0 0
- Iframe高度自适应
- iframe 的自适应高度
- 是Iframe高度自适应
- iframe 的自适应高度
- iframe自适应高度
- Iframe自适应高度
- 让IFRAME自适应高度
- Iframe 自适应高度宽度
- iframe自适应高度
- iframe自适应高度
- Iframe自适应高度[摘]
- 让Iframe自适应高度
- IFRAME自适应高度
- iframe自适应高度[转]
- iframe自动自适应高度
- iframe 自适应高度
- Iframe自适应高度
- iframe自适应高度
- 请求WebService出现"因 URL 意外地以 结束,请求格式无法识别"解决方法
- jquery动态加载js文件
- C++第五次上机--作业报告
- 【LeetCode】154. Find Minimum in Rotated Sorted Array II
- Nodejs 搭建https服务器(二)
- Iframe自适应高度
- UEditor添加一个普通按钮及其他使用注意事项
- 欢迎使用CSDN-markdown编辑器
- Windows7与Window2008 64位IIS7上面DCOM配置Excel、Word等
- hrbust 1864人类希望——kokoⅠ【数学+快速幂】
- 无刷新上传
- React Native (五):上下拉刷新加载
- 网络传输压缩DLL: ICSharpCode.SharpZipLib
- MySQL事务实现方法 、数据库索引