메뉴 건너뛰기

프로그램언어

조회 수 21862 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
<script language='JavaScript' type='text/javascript'>
function resizeFrame(iframeObj){
        var innerBody = iframeObj.contentWindow.document.body;
        oldEvent = innerBody.onclick;
        innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };

        var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
        iframeObj.style.height = innerHeight;

        if( !arguments[1] )        /* 특정 이벤트로 인한 호출시 스크롤을 그냥 둔다. */
                this.scrollTo(1,1);
}
</script>
---------------------------------------------------------------------

iframe을 다음과 같이 넣는다.
---------------------------------------------------------------------
 <iframe width=600 height=600 src="내용의경로" onload="resizeFrame(this)"  frameborder=0></iframe>         
---------------------------------------------------------------------

 

위와 같이 넣으면 ifrmae의 크기가 자동조절된답니다

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved