iframe自适应高度

 

iframe:

<iframe src="http://www.cncsen.com/news!list.action?code=6" id="itwo" frameborder="0" onscroll="no" onload="changeFrameHeight()" style="width: 100%;"></iframe>

 

js:

        function changeFrameHeight() {
            var ifm = document.getElementById("itwo");
            ifm.height = document.documentElement.clientHeight - 5;
        }
        window.onresize = function() {
            changeFrameHeight();
        }

 

posted @ 2017-11-14 13:56  007少侠  阅读(248)  评论(0编辑  收藏  举报
友情链接:便宜vps(CN2GIA线路)
站长统计: