ie7 에서 세로폭 자동으로 호환되는 아이프레임 소스좀 공유해주세요 정보
ie7 에서 세로폭 자동으로 호환되는 아이프레임 소스좀 공유해주세요
본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
세로사이즈를 자동으로 맞추게 하고 싶은데 정말 힘들군요
그누 게시판 view.skin.php 에 파일 받는 곳을 약간 개조해서
<iframe src="<?=$view[link][2];?>" width="100%" ........></iframe>
와 같이 write.skin.php 링크 2에 주소를 넣어주면 view.skin.php 에 해당 파일이 펼쳐지는 형태입니다.
세로사이즈가 모두 동일하다면 상관없겠는데 세로폭이 들쑥 날쑥됩니다.
이런 문제로 height="" 잡아주지를 못하고 있네요...
여기저기 검색해서 끼워넣어봤는데 모두 안되네요...
갖고 계신 코드 있으시면 도와주세요
오류 주소 :
세로사이즈를 자동으로 맞추게 하고 싶은데 정말 힘들군요
그누 게시판 view.skin.php 에 파일 받는 곳을 약간 개조해서
<iframe src="<?=$view[link][2];?>" width="100%" ........></iframe>
와 같이 write.skin.php 링크 2에 주소를 넣어주면 view.skin.php 에 해당 파일이 펼쳐지는 형태입니다.
세로사이즈가 모두 동일하다면 상관없겠는데 세로폭이 들쑥 날쑥됩니다.
이런 문제로 height="" 잡아주지를 못하고 있네요...
여기저기 검색해서 끼워넣어봤는데 모두 안되네요...
갖고 계신 코드 있으시면 도와주세요
댓글 전체
제가 사용하고 있는 코드입니다.. 익스6,익스7,파이어폭스 다잘될거에요..
<script language='JavaScript' type='text/javascript'>
function resizeFrame(iframeObj){
var innerBody = iframeObj.contentWindow.document.documentElement;
oldEvent = innerBody.onclick;
innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
// var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
if(document.all) var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
else var innerHeight = innerBody.offsetHeight;
iframeObj.style.height = innerHeight+'px';
// var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
iframeObj.style.width = 746 + 'px'; //가로 사이즈
if( !arguments[1] ) /* 특정 이벤트로 인한 호출시 스크롤을 그냥 둔다. */
this.scrollTo(1,1);
}
</script>
<iframe id="ifr" name="ifr" src="주소" width="746px" onload="resizeFrame(this)" scrolling="no" frameborder="0"></iframe>
가로 사이즈는 지정하신 사이즈 넣어주세요.
iframe에는 onload="resizeFrame(this)" 를 걸어주심 되겠네요..
<script language='JavaScript' type='text/javascript'>
function resizeFrame(iframeObj){
var innerBody = iframeObj.contentWindow.document.documentElement;
oldEvent = innerBody.onclick;
innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
// var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
if(document.all) var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
else var innerHeight = innerBody.offsetHeight;
iframeObj.style.height = innerHeight+'px';
// var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
iframeObj.style.width = 746 + 'px'; //가로 사이즈
if( !arguments[1] ) /* 특정 이벤트로 인한 호출시 스크롤을 그냥 둔다. */
this.scrollTo(1,1);
}
</script>
<iframe id="ifr" name="ifr" src="주소" width="746px" onload="resizeFrame(this)" scrolling="no" frameborder="0"></iframe>
가로 사이즈는 지정하신 사이즈 넣어주세요.
iframe에는 onload="resizeFrame(this)" 를 걸어주심 되겠네요..
음...고맙습니다.^^
이거 완벽히 되네요~ 감사합니다 ^^
좋은 정보 감사합니다.
적용했는데, 지마켓에서는 높이가 조절되지 않네요.
혹시 방법이 있을까요??
혹시 방법이 있을까요??