Search Results for 'HTML'


1 POSTS

  1. 2007.12.08 iframe 사이즈(크기) 자동 조정

iframe 사이즈(크기) 자동 조정

Posted 2007.12.08 03:52 by 선율아빠

<script>
function doResize()
{
container.height = main.document.body.scrollHeight;
container.width = main.document.body.scrollWidth;
}
</script>

<td id="container">
<iframe src="주소" name="main" width="100%" height="100%" scrolling='no' frameborder='0' marginwidth="0" marginheight="0" frameborder="no" onload="doResize()"></iframe>
</td>


-------------------------------------------------------------------------------
or,

<script>
function doResize(o) {
    var frameBody = o.contentWindow.document.body;
    o.style.width  = frameBody.scrollWidth + (frameBody.offsetWidth-frameBody.clientWidth);
    o.style.height = frameBody.scrollHeight + (frameBody.offsetHeight-frameBody.clientHeight);
}

</script>


<body>
<table width="10" height="10" border="0">
    <tr>
        <td>
            <iframe src="주소" name="main" width="100%" height="100%" scrolling='no' frameborder='0' marginwidth="0" marginheight="0" frameborder="no" onload="doResize(this);"></iframe>
        </td>
    </tr>
</table>
</body>

신고

Tag : , ,

티스토리 툴바