iframe高度从内向外撑起

index.html:

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

 

con.html

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

 

ok了.

posted @ 2015-03-11 11:42  思思博士  阅读(452)  评论(6编辑  收藏  举报