본문 바로가기
카테고리 없음

iframe resize

by 휘루걸음 2011. 10. 19.
728x90
반응형
출처 : http://kimtaiyong.blog.me/150069488666

<head> </head> 사이에 우선 아래 소스를 넣는다.

 

<script type="text/javascript">
function init(){
  var doc = document.getElementById('content');
  if(doc.offsetHeight == 0){
  } else {
  pageheight = doc.offsetHeight;

  parent.document.getElementById("contentFrame").height = pageheight+"px";
  }
}
window.onload = function(){
  init();
}

</script>

 

그리고 아이프레임 위치하려는 위치에 아래 소스를 삽입하면 된다.

 

<iframe  src="부를 경로 고고" frameborder=0 scrolling=no width="660px"  height="100%" name="contentFrame" id="contentFrame" allowTransparency="true"></iframe>


728x90
반응형