자바스크립트 iframe 자동 높이 조절
0
본문
iframe에서 내용의 높이에 따라 높이가 자동 조절되는 자바스크립트이다.
자바스크립트
<script type="text/javascript"> function resizeIframeToFitContent(iframe){ var height = 600; var theFrame = window.frames[iframe.id]; theFrame.frameElement.height = height; height = parseInt(theFrame.document.body.scrollHeight); theFrame.frameElement.height = height; } </script> |
HTML
<iframe id="myiframe" name="myiframe" src="[아이프레임 경로]" width="100%" onload="resizeIframeToFitContent(this)" scrolling="no" frameborder="0"></iframe> |
댓글목록
등록된 댓글이 없습니다.