首页 > 其他 > 详细

iframe 高度宽度自适应

时间:2016-08-10 12:42:32      阅读:132      评论:0      收藏:0      [点我收藏+]
                <iframe id="iframeHome" name="iframeHome" src="/Page/NewHome/GongZuoTai.html" scrolling="yes" onload="iFrameHeight()"
                        frameborder="0" style="padding: 0px; width:980px;float:left; margin:0; padding:0;"></iframe>
function iFrameHeight() {
    alert("123");
    var ifm = document.getElementById("iframeHome");
    var subWeb = document.frames ? document.frames["iframeHome"].document : ifm.contentDocument;
    if (ifm != null && subWeb != null) {
        ifm.height = subWeb.body.scrollHeight;
        ifm.width = subWeb.body.scrollWidth;
    }
}

 

function iFrameHeight() {    alert("123");    var ifm = document.getElementById("iframeHome");    var subWeb = document.frames ? document.frames["iframeHome"].document : ifm.contentDocument;    if (ifm != null && subWeb != null) {        ifm.height = subWeb.body.scrollHeight;        ifm.width = subWeb.body.scrollWidth;    }}

iframe 高度宽度自适应

原文:http://www.cnblogs.com/zxcnn/p/5756207.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!