본문 바로가기

개발/Java Script

[Tip] iframe 콘텐츠에 맞게 높이 조정(스크롤 안생기게)

<script type="text/j-vascript">
// iframe resize
function autoResize(ifrm)
{
    var iframeHeight= (ifrm).contentWindow.document.body.scrollHeight;
    (i).height=iframeHeight+20;
}
</script>


...


<iframe ... onload="autoResize(this)" ... ></iframe>


위와 같이 하면 iframe 콘텐츠에 맞게 사이즈가 조정된다.

'개발 > Java Script' 카테고리의 다른 글

[Refactoring] if 문 대체  (0) 2024.03.22
[Tip] input type="text" 에 대문자 입력 방법  (0) 2015.01.02
[Tip] ModalDialog 사용 시 주의점  (0) 2014.12.10
[jqGrid] 기본 CRUD  (0) 2013.10.25
[Date] 현재 일자 얻는 방법  (0) 2013.10.10