iframe自适应宽度

<iframe id="course_content" style="width:100%;margin:5px 0 0;" scrolling="no" src="<?php ?>" ></iframe>
 <script>
      $("#course_content").load(function() {
          var iframeHeight = $(this).contents().find("div.para").height();
          if(iframeHeight<180)
          {
              var iframeHeight = $(this).contents().find("body").height();
              $(this).height(iframeHeight+30);
          }
          else{
              //alert(iframeHeight+160);
              $(this).height(iframeHeight+160);
          }
      });
       </script> 

 

全部评论

相关推荐

算法丰川祥:实际就两个人给他投,它这么说好显得自己比较抢手
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务