我在项目A的jsp中嵌入了一个iframe,iframe的src 的路径是项目B ,我想要iframe的高度可以根据iframe中嵌的内容的高度实现自适应,跪求大神帮忙
<iframe onload="this.style.height=Math.max(this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.scrollHeight)+'px'"
var s = '';为什么是空的。。。
style="heigth:100%;width:100%"
高度用JS实现,获取窗口大小并赋值$('.iframe').height($(window).height()); width就是在CSS中设置100%就可以了