码迷,mamicode.com
首页 > 其他好文 > 详细

iframe高度从内向外撑起

时间:2016-11-14 02:56:23      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:iframe

index.html:

?

1
2
<div style="height: 200px;"></div>
<iframe id="gys" src="con.html" width="100%"></iframe>

 

con.html

?

1
2
3
<body onload="parent.window.document.all.gys.height=document.body.scrollHeight">
        <div style="height: 1800px; width: 500px; margin: 0 auto; "></div>
    </body>


iframe高度从内向外撑起

标签:iframe

原文地址:http://yanhuang.blog.51cto.com/12278737/1872326

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!