iframe切换src后高度自适应

  1. 绑定onload函数
    onload="this.height=this.contentWindow.document.body.scrollHeight;"
  2. 切换iframe的src前,更改它的高度
    $("#contentFrame0").attr('height', 'auto');
posted @ 2020-08-08 21:40  darkclouds  阅读(321)  评论(0编辑  收藏  举报