iframe跨域自适应高度
来源:互联网 发布:vscode hexdump 编辑:程序博客网 时间:2024/05/21 17:08
在子页面的js代码:
function IFrameResize() {var bgh = $('#bg', window.parent.document)bgh.height(0);//alert($('#bg', window.parent.document).height());//alert($('#auction_bg', window.parent.document).height());//alert(this.document.body.scrollHeight); //弹出当前页面的高度var obj = parent.document.getElementById("div_view"); //取得父页面IFrame对象 obj.height = 0;obj.height = this.document.body.scrollHeight; //调整父页面中IFrame的高度为此页面的高度 if (this.document.body.scrollHeight > 798) {$('#bg', window.parent.document).height(obj.height)} else {$('#bg', window.parent.document).height(798)}}子页面的body onlaod=“IFrameResize()”
其实就是在子页面中获取到当前页面的高度,然后获取到父页面的iframe对象,把子页面的高度set给父页面iframe的高度。
0 0
- iframe 跨域自适应高度
- Iframe跨域自适应高度
- iframe跨域高度自适应
- iframe跨域自适应高度
- iframe 跨域自适应高度
- iframe跨域自适应高度
- iframe 跨域自适应高度的解决方案
- 解决iframe跨域高度自适应问题
- iframe跨域自适应宽度,高度
- 解决跨域iframe自适应高度
- 跨域自适应高度——iframe
- 完美实现跨域Iframe高度自适应
- iframe 跨域自适应高度的解决方案
- 嵌入跨域iframe高度自适应
- 跨域设置iframe的高度自适应
- 完美实现跨域Iframe高度自适应【Iframe跨域高度自适应解决方案】
- 完美实现跨域Iframe高度自适应【Iframe跨域高度自适应解决方案】
- 完美实现跨域Iframe高度自适应【Iframe跨域高度自适应解决方案】
- 地图线路指引
- Windows API学习-Hook学习
- iOS7初体验(1)——第一个应用程序HelloWorld
- Oracle Merge 使用
- GPS 纠偏算法
- iframe跨域自适应高度
- 带有可变参数的宏(Macros with a Variable Number of Arguments)
- Biggest Number
- iOS如何让主界面不显示NavigationBar,而后面的有
- UIWebView之获取所点位置图片URL
- js前端排序
- 解决程序启动时mysql出现 unauthenticated user导致数据库处理慢的问题
- 集成struts2框架步骤
- 【单独编译使用WebRTC的音频处理模块 - android】