首页 > 其他 > 详细

iFrame在chrome中高度的问题。

时间:2015-09-11 12:38:56      阅读:397      评论:0      收藏:0      [点我收藏+]

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

 JS中加上面代码,iframe 加下面代码。

 

 <iframe id="main_if" src="@Url.Action("indexInfo")"  frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight()"></iframe>

 

之前真不知道 Iframe在chrome中 还有这毛病。还是IE好。

iFrame在chrome中高度的问题。

原文:http://www.cnblogs.com/qq22144770/p/4800320.html

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