tongyinaocan
<iframe id="iframe" onLoad="AutoFit();" frameborder="0" scrolling="no" src="http://www.cnblogs.com">
</iframe>

JQuery代码:

function AutoFit() {
    var ifm = document.getElementById("iframe");
    var subWeb = document.frames ? document.frames["article_frame"].document : ifm.contentDocument;
    if (ifm != null && subWeb != null) {
    $("#iframe").css({ "width": subWeb.body.scrollWidth + "px" });
    $("#iframe").css({ "height": subWeb.body.scrollHeight + "px" }); 
  }
}

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-06-12
  • 2022-12-23
相关资源
相似解决方案