Home  >  Article  >  Web Front-end  >  iframe 多层嵌套 无限嵌套 高度自适应的解决方案_HTML/Xhtml_网页制作

iframe 多层嵌套 无限嵌套 高度自适应的解决方案_HTML/Xhtml_网页制作

WBOY
WBOYOriginal
2016-05-16 16:39:512124browse

有A,B,C三个页面,A页面包含B页面,B页面包含C页面.A页面随着B页面自适应,C页面随着B页面自适应
A页面

复制代码
代码如下:


onload="this.height=main.document.body.scrollHeight;this.width=main.document.body.scrollWidth;if(this.height



B页面

复制代码
代码如下:




左边菜单







C页面
将下面这个JS函数写到 最最底层的页面中(即最孙子的那个页面) 并在body的onload事件中调用该方法 【下面这个公式是万能公式】

复制代码
代码如下:







这里可以写真正的内容 并且给该div的padding-bottom设一个值


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn