iframe 자동 높이 조절
페이지 정보
작성자
와우누리
본문
iframe 자동 높이 조절
layout.html에 이 소스를 추가해 보세요~
<script type="text/javascript">
// 아이프레임 세로 자동 리사이징 (세로값을 자동으로 추출하여 스크롤바 생기지 않음)
function resizeFrame(frm) {
frm.style.height = "auto";
contentHeight = frm.contentWindow.document.body.scrollHeight;
frm.style.height = contentHeight + 4 + "px";
}
</script>
그리고 아이프레임 쓰실 때
<iframe src="아이프레임 주소" id="아이프레임 아이디 (없어도 무방)" width="1000px" height="0px" marginwidth="0px" marginheight="0px" frameborder="no" scrolling="no" align="center" onload="resizeFrame(this)"></iframe>
코드를 이런 식으로 쓰면 됩니다.
크로스브라우징 지원하더군요^^
내용출처:
jQuery iframe auto height plugin
http://plugins.jquery.com/iframe-auto-height/
나때는 말이야 [나때말]
iframe,아이프레임,iframe높조절,iframe사이즈
댓글 0