Centos7上安装OpenLDAP
2016-01-18 12:48
525 查看
在页面无刷新更新方面,虽然现在的ajax很强悍,但是处理代码相对多点。想比之下,iframe就简单多了!处理iframe的自适应宽、高,会经常用到,网上整理了一份,写在这里备用:
单个iframe 高度自适应:
<iframe id="iFrame1" name="iFrame1" width="100%" onload="this.height=iFrame1.document.body.scrollHeight" frameborder="0" src="index.htm"></iframe>
起作用的是这句:onload="this.height=iFrame1.document.body.scrollHeight"
多层嵌套iframe 高度自适应:
A页面的iframe:
<iframe id="frame_content" src=”B.php“ name="right" width="1003" frameborder="0" scrolling="no" ></iframe>
B.php页面又有一个iframe:
<iframe width="750" name="rightform" id="rightform" src="KinTimMng_right_init.php" frameborder="0" scrolling="no" onload="this.height=rightform.document.body.scrollHeight;parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px';" ></iframe>
起作用的代码是这句:onload="this.height=rightform.document.body.scrollHeight;parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px';"
onload的时候执行了两条js语句:
1、设置当前iframe自己的高度自适应
this.height=rightform.document.body.scrollHeight
2、设置父iframe的高度自适应(注意后面的高度单位px,如果不加单位,firefox下不起作用)
parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px'
以上代码在ie6、ie7、ie8、firefox3.5下测试通过
单个iframe 高度自适应:
<iframe id="iFrame1" name="iFrame1" width="100%" onload="this.height=iFrame1.document.body.scrollHeight" frameborder="0" src="index.htm"></iframe>
起作用的是这句:onload="this.height=iFrame1.document.body.scrollHeight"
多层嵌套iframe 高度自适应:
A页面的iframe:
<iframe id="frame_content" src=”B.php“ name="right" width="1003" frameborder="0" scrolling="no" ></iframe>
B.php页面又有一个iframe:
<iframe width="750" name="rightform" id="rightform" src="KinTimMng_right_init.php" frameborder="0" scrolling="no" onload="this.height=rightform.document.body.scrollHeight;parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px';" ></iframe>
起作用的代码是这句:onload="this.height=rightform.document.body.scrollHeight;parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px';"
onload的时候执行了两条js语句:
1、设置当前iframe自己的高度自适应
this.height=rightform.document.body.scrollHeight
2、设置父iframe的高度自适应(注意后面的高度单位px,如果不加单位,firefox下不起作用)
parent.document.getElementById('frame_content').style.height= document.body.scrollHeight + 'px'
以上代码在ie6、ie7、ie8、firefox3.5下测试通过
相关文章推荐
- linux下安装软件
- Linux学习之lsof命令
- Linux下设置定期执行脚本
- Linux命令之ifconfig
- linux 的 最大10个文件
- Linux下的softlink和hardlink
- Linux内核TCP/IP参数分析与调优
- Linux下MySQL数据库的备份与还原
- 常用的Linux系统调用命令
- 在Linux上搭建git server
- Centos7安装phpldapadmin
- 详解LINUX的交换分区---SWAP
- linux 驱动 i2c
- Linux 基本命令
- Linux curses 总结三(窗口)
- linux下md5sum应用
- UTF-8和中文字符编码(GB2312、GBK、GIB5、GB18030)的识别
- linux 常用基本命令之九 uname
- 《Linux内核设计与实现》读书笔记(七)- 中断处理【转】
- Linux下用户及用户组的管理