开发者社区 问答 正文

html中iframe的高度问题

我在项目A的jsp中嵌入了一个iframe,iframe的src 的路径是项目B ,我想要iframe的高度可以根据iframe中嵌的内容的高度实现自适应,跪求大神帮忙

展开
收起
小旋风柴进 2016-03-16 17:18:05 2148 分享 版权
1 条回答
写回答
取消 提交回答
  • <iframe onload="this.style.height=Math.max(this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.scrollHeight)+'px'"

    2019-07-17 19:04:09
    赞同 展开评论
问答分类:
问答标签:
问答地址: