iframe 自适应高度,兼容各浏览器
2012-03-13 14:43
369 查看
<script language="javascript" type="text/javascript"> function dyniframesize(down){ var pTar = null; if (document.getElementById){ pTar = document.getElementById(down); }else{ eval('pTar = ' + down + ';'); } if (pTar && !window.opera){ //begin resizing iframe pTar.style.display="block" if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){ //ns6 syntax pTar.height = pTar.contentDocument.body.offsetHeight +20; pTar.width = pTar.contentDocument.body.scrollWidth+20; }else if (pTar.Document && pTar.Document.body.scrollHeight){ //ie5+ syntax pTar.height = pTar.Document.body.scrollHeight; pTar.width = pTar.Document.body.scrollWidth; } } } </script>
<iframe src ="http;//www.jcsdljj.com" frameborder="0" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" id="ifm_dysize" name="ifm_dysize" onload="javascript:dyniframesize('ifm_dysize');" width="100%"></iframe>
相关文章推荐
- Iframe自适应高度兼容ie,firefox多浏览器
- JavaScript设置IFrame高度自适应(兼容多浏览器)
- iframe高度宽度自适应兼容所有浏览器
- 基于jquery的兼容各种浏览器的iframe自适应高度的脚本
- 兼容多浏览器的iframe高度自适应问题
- 兼容多浏览器的iframe自适应高度(ie8 、谷歌浏览器4.0和 firefox3.5.3)
- iframe自适应高度(兼容多种浏览器)
- 沫沫金;;最新Iframe全浏览器兼容自适应高度解决方案
- Iframe的高度自适应且兼容谷歌,火狐,IE和360等主流浏览器
- 【开发过程问题汇总系列】【iframe自适应高度】兼容 FireFox和IE内核的浏览器
- 兼容主流浏览器的 iframe 自适应高度(很实用)
- 兼容主流浏览器的iframe自适应高度js脚本
- iframe高度自适应及多浏览器兼容
- Iframe自适应高度兼容ie,firefox多浏览器
- iframe自适应高度(兼容多种浏览器)
- iframe自适应高度(兼容多种浏览器)
- 基于jquery的兼容各种浏览器的iframe自适应高度的脚本
- iframe显示高度自适应 兼容多浏览器