获得iframe 高度 ,各种浏览器
2024-09-20 06:41:31
function fuFunctiondan(){
var frm=$("#z_div");
var iframeHeight=0;
if (navigator.userAgent.indexOf("Firefox")>0) { // Mozilla, Safari, ...
iframeHeight=window.frames[0].document.body.scrollHeight;
alert(iframeHeight);
iframeHeight=parseInt(iframeHeight)+0;
frm.height(iframeHeight);
$("#MainFrame").height(iframeHeight);
} else if (navigator.userAgent.indexOf("MSIE")>0) { // IE
iframeHeight=MainFrame.document.body.scrollHeight;//IE这里要用,不能用obj,切记
iframeHeight=parseInt(iframeHeight)+parseInt(0);
frm.height(iframeHeight);
$("#MainFrame").height(iframeHeight);
}else {
iframeHeight=MainFrame.document.body.scrollHeight;
iframeHeight=parseInt(iframeHeight)+0;
frm.height(iframeHeight);
$("#MainFrame").height(iframeHeight);
}
}
z_div为iframe 外层div 的id,
MainFrame为iframe 的id ;
最新文章
- 报错问题:InnoDB: Error: log file ./ib_logfile0 is of different size
- solr6.1-----mysql 数据导入-查询
- Match:Power Strings(POJ 2406)
- How to create a project with Oracle Policy Modeling
- NGUI Draw Calls优化(思路)
- IntelliJ IDEA 14.0.2破解注册码文件(2015年06月08日)
- 解决Tomcat 7遇到StackOverflowError的异常
- Codeforces Round #328 (Div. 2) B. The Monster and the Squirrel 打表数学
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState:
- J2SE知识点摘记(五)
- PHP的环境搭建
- 解析 Javascript - this
- jQuery链式编程
- asp.net mvc cshtml (VIEWS)中怎么提供URL参数:
- Vue脚手架使用步骤 2.9.6版本
- Linux设备驱动剖析之Input(二)
- UVA 10733 - The Colored Cubes(Ploya)
- UVA 350 Pseudo-Random Numbers
- Delphi XE7的安卓程序如何调用JAVA的JAR,使用JAVA的类?
- thinkphp5框架生成二维码(二)