사이트 내 전체검색
아이프레임 오토 리사이즈 컨트롤 - 동일 도메인
https://cmd.kr/javascript/272 URL이 복사되었습니다.

본문

아이프레임을 삽입하는 부모 페이지에서 설정합니다.

<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function reSize(){
    try {
        var objBody = ibody.document.body;
        var objFrame = document.all["ibody"];
        ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
        //alert(objBody.offsetHeight)
        if (ifrmHeight > 450) {
            objFrame.style.height = ifrmHeight
        }else{
            objFrame.style.height = 450;
        }
            objFrame.style.width = '100%'
        } catch(e) {
        // Do nothing
    }
}
function init_iframe(){
    reSize();
    setTimeout('init_iframe()',200)
}
init_iframe();
//-->
</SCRIPT>
</HEAD>
<BODY>

<iframe name="ibody" src="#####" width="95%" height="450" frameborder="0" framespacing="0" marginheight="0" marginwidth="0" scrolling="no" vspace="0"></iframe>

출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=84

댓글목록

등록된 댓글이 없습니다.

831 (10/17P)

Search

Copyright © Cmd 명령어 3.142.90.235