iframe 根据内容自适应高度-终极解决方案

织梦教程 强烈建议 2024-02-06 14:21 114 0

  在主页面 iframe onLoad 时间里面写

  function iframeLoad()

  {

  document.getElementById("iframe").height=0;

  document.getElementById("iframe").height=document.getElementById("iframe").contentWindow.document.body.scrollHeight;

  }

  下面是示例代码

  

  



时间:(2024-02-06 14:21:19)
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!