码迷,mamicode.com
首页 > 其他好文 > 详细

iFrame在chrome中高度的问题。

时间:2015-09-11 12:41:39      阅读:137      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!