iframe 스크롤없이 동적 사이즈 변경 > 소스코드

본문 바로가기
사이트 내 전체검색


회원로그인

소스코드

javascript | iframe 스크롤없이 동적 사이즈 변경

페이지 정보

작성자 100K5 작성일14-10-29 11:29 조회69,165회 댓글0건

본문

# 부모 페이지
<script type="text/javascript">
// iframe  
function iframe_autoresize(arg){
   arg.height = eval(arg.name + ".document.body.scrollHeight");
}
</script>
<iframe src="schedule_list01.php" width="100%" height="40" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" name="schedule_ifr01" id="schedule_ifr01" onload="iframe_autoresize(this)"></iframe>

# iframe 페이지
<script type="text/javascript">
function iframe_reset(){
   var dataobj = document.getElementById("page_content");
   dataobj.style.top = 0;
   dataobj.style.left = 0;
   pagelength = dataobj.offsetHeight;
   pagewidth = dataobj.offsetWidth;

   parent.document.getElementById("schedule_ifr01").height = pagelength;
   parent.document.getElementById("schedule_ifr01").width = pagewidth;
}
window.onload = iframe_reset;
</script>

<!-- html 영역 -->
<div align=center id="page_content" style="position:absolute;left:0;top:0;width:100%"> 
   <table>
    <tr>
        <td>내용부분</td>
   </tr>
    </table>
</div> 

댓글목록

등록된 댓글이 없습니다.


사이트소개 개인정보취급방침 서비스이용약관 Copyright © kkujunhee.net All rights reserved.
상단으로

개인정보관리책임자 : 관리자

모바일 버전으로 보기