解决iframe高度自适应的问题

html

        <iframe src="http://124.128.23.74:8008/group26/hm_weixin/index.php/Webservice/V100/aboutus" id="myiframe" scrolling="no" onload="changeFrameHeight()" frameborder="0"></iframe>

js

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

 

posted @ 2017-11-23 14:57  欧辰0312  阅读(209)  评论(0编辑  收藏  举报