iframe 높이 자동조절 스크립트 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

iframe 높이 자동조절 스크립트 정보

JavaScript iframe 높이 자동조절 스크립트

본문

<script language='javascript'>
<!--
function changeHeight() {
//아이프레임 안쪽 페이지 높이를 먼저구하신후
var the_height=document.getElementById('content').contentWindow.document.body.scrollHeight;
// 아이프레임 높이를 바꿔주시면 됩니다.
document.getElementById('content').height=the_height; }
//-->
</script>


<iframe id='content'
frameborder=0
width=100%
scrolling=no
onLoad="changeHeight();"
src='content.php'>
</iframe>
추천
0
  • 복사

댓글 7개

© SIRSOFT
현재 페이지 제일 처음으로