Iframe 自适应高度应用
来源:互联网 发布:钣金外壳 软件 编辑:程序博客网 时间:2024/06/11 12:38
方案一:parent.jsp
Script:
function iFrameHeight() { var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
<span style="white-space:pre"></span>if(ifm != null && subWeb != null) {<span style="white-space:pre"></span>ifm.height = subWeb.body.scrollHeight;<span style="white-space:pre"></span>}}
HTML:
<iframe src="" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height=100% id="iframepage" name="iframepage" onLoad="iFrameHeight()"></iframe>方案二:parent.jsp
Script:
function iFrameHeight(rSize) {if(undefined==rSize)return; var ifm= document.getElementById("iframepage");ifm.height = rSize*150+(10-rSize)*10 ; //动态计算iframe页面有多少行,10-rSize 是由于底部无法显示全分页才加的 }
HTML:
<iframe src="" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height=100% id="iframepage" name="iframepage" ></iframe>children.jsp
Script:
$(function(){
window.parent.iFrameHeight(${page.list.size()});
});
0 0
- Iframe 自适应高度应用
- Iframe高度自适应
- iframe 的自适应高度
- 是Iframe高度自适应
- iframe 的自适应高度
- iframe自适应高度
- Iframe自适应高度
- 让IFRAME自适应高度
- Iframe 自适应高度宽度
- iframe自适应高度
- iframe自适应高度
- Iframe自适应高度[摘]
- 让Iframe自适应高度
- IFRAME自适应高度
- iframe自适应高度[转]
- iframe自动自适应高度
- iframe 自适应高度
- Iframe自适应高度
- Android- fill_parent、wrap_content和match_parent的区别
- HDU 1023 Train Problem II(卡特兰数)
- C# 排序列表(SortedList)
- 使用泛型的单链表
- I love you 转变为 I evol uoy
- Iframe 自适应高度应用
- CocoaPods进阶:本地包管理
- Java学习笔记:Arrays
- Unity中使用UGUI与ScrollView的练习
- Speech Memorization
- Nginx运行php的配置
- HDOJ-1024 Max Sum Plus Plus (最大M子段和问题)
- 【leetcode】Remove Linked List Elements
- 【Quartz】Quartz存储与持久化-基于quartz.properties的配置