2009-07-03

iframe 높이를 내용 크기에 맞추기

<iframe id="trac" width="100%" src="http://www.google.com" 
style="border-width:0;" frameborder="0" scrolling="no"></iframe>
<script>
var trac = document.getElementById("trac");
trac.onload = function() {
    trac.height = trac.contentWindow.document.body.scrollHeight;
}
</script>

댓글 없음:

댓글 쓰기