아이프레임 리사이즈 > 그누보드5 팁자료실

그누보드5 팁자료실

아이프레임 리사이즈 정보

아이프레임 리사이즈

본문

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/JavaScript">
$(document).ready(function(e) {
 $('#ifrm').load(function() {
  $(this).height($(this).contents().find('body')[0].scrollHeight+30+"px");
//  $(this).width($(this).contents().find('body')[0].scrollWidth+"px");
 });
});
</script>

<iframe id="ifrm" width="100%" frameborder="0" marginwidth="0" scrolling="no" src="블러올 주소"></iframe>

이제까지 해본것중 제일 작동을 잘 하네요..
추천
4

댓글 11개

블러올 주소에 네이버 블로그주소를 넣으니깐 적용이 안돼내요;;;

그리고 위에 제이쿼리 주소는 그누보드5에서 제공하는 제이쿼리 js 도 있는데 둘다 써야 하는건가요?
아래는 모바일에서 잘되는 아이프래임입니다

<script>
 
 // 적용할 IFRAME의 이름
 var strName = "ifrm";
 
 function getReSize()
 {
    try {
      var objFrame = document.getElementById(strName);
      var objBody = ifrm.document.body;
 
      ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
 
      if (ifrmHeight > 300) {
      objFrame.style.height = ifrmHeight + "px";
      } else {
      objFrame.style.height = 300;
      }
      objFrame.style.width = '100%'
    } catch(e) {}
 }
 
 function getRetry()
 {
    getReSize();
    setTimeout('getRetry()',500);
 }
 
 getRetry();
 
</script>


<iframe src="본인도메인
" frameborder="0" width="100%" height="768" allowTransparency="true"
name="ifrm" id="auto_iframe" marginwidth="0" marginheight="0" scrolling="no"
allowtransparency="true"></iframe>
전체 2,427 |RSS
그누보드5 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT