jQuery | iframe 컨텐츠의 높이 변경에 따라 자동 높이 조절 하기
페이지 정보
작성자 100K5 작성일14-02-11 10:33 조회65,022회 댓글0건첨부파일
- iframeheight.js (14.6K) 10회 다운로드 DATE : 2015-09-23 18:57:56
관련링크
본문
방법 1
<IFRAME style="MIN-HEIGHT:550px" name="the_iframe" id="the_iframe" src="소스경로.php" frameBorder="0" width="100%" scrolling="no"></IFRAME>
<script type="text/javascript">
$(document).ready(function(e) {
$('#the_iframe').load(function() {
$(this).height($(this).contents().find('body')[0].scrollHeight+30+"px");
});
});
</script>
방법 2
<script type="text/javascript" src="/js/iframeheight.js"></script>
<script type="text/javascript">
$(function(){
$('#the_iframe').iframeHeight({
resizeMaxTry : 2,
resizeWaitTime : 300,
minimumHeight : 100,
defaultHeight : 100,
heightOffset : 90,
exceptPages : "",
debugMode : false,
visibilitybeforeload : true,
blockCrossDomain : true,
externalHeightName : "bodyHeight",
onMessageFunctionName : "getHeight",
domainName : "*",
watcher : true,
watcherTime : 400
});
});
</script>
<IFRAME name="the_iframe" id="the_iframe" src="소스경로.php" frameBorder="0" width="100%" scrolling="no"></IFRAME>
댓글목록
등록된 댓글이 없습니다.