티스토리 뷰

<HTML>
<head>
<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;
  var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
  iframeObj.style.width = innerWidth;    
  if( !arguments[1] )        /* 특정 이벤트로 인한 호출시 스크롤을 그냥 둔다. */
    this.scrollTo(1,1);
 }
</script>
</head>
<body>
<h4>iframe 내 페이지 높이에 맞게 자동 조절하기
</h4>
<iframe name="wsos" id="wsos" src="/webdevdoc/index.php" style="width:100%"
 frameborder="0" framespacing="0" scrolling="no" onLoad="resizeFrame(this);"></iframe>

</body>
</html>
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/01   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함