m

크로스브라우징 관련 아이프레임 리사이징 질문드려요

· 2013-03-24 (일) 15:23:27 · 2761 · 3
질문답변게시판에서 검색하여 찾아낸 두가지 소스로 실험하고 있습니다...

1번의 경우
http://iparasol.co.kr/sub/board/free_board_header_edit-1.html
크롬에선 잘 돌아가는데 IE에선 리사이징이 안됩니다

사용한 소스>>

<iframe id="embeded-content" width="100%" src="http://iparasol.co.kr/gnuboard4/bbs/board.php?bo_table=free_board" scrolling="NO" marginwidth="0" marginheight="0" frameborder="0" allowTransparency="true"></iframe>
<script type="text/javascript">
function resize_frame(id) {
var frm = document.getElementById("embeded-content");
function resize() {
frm.style.height = "auto"; // set default height for Opera
contentHeight = frm.contentWindow.document.documentElement.scrollHeight;
frm.style.height = contentHeight + 23 + "px"; // 23px for IE7
}
if (frm.addEventListener) {
frm.addEventListener('load', resize, false);
} else {
frm.attachEvent('onload', resize);
}
}
resize_frame('embeded-content');
</script>


2번의 경우
http://iparasol.co.kr/sub/board/free_board_header_edit-2.html
IE에선 잘 돌아가는데 크롬에선 리스트로는 제대로 출력되나
글에 들어가면 프레임이 쭉 늘어나더니 줄어들질 않구요

사용한 소스>>

<script language="JavaScript">
function reSize() {
try {
var objBody = auto_iframe.document.body;
var objFrame = document.all["auto_iframe"];
ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
objFrame.style.height = ifrmHeight;
}
catch(e) {}
}

function init_iframe() {
reSize();
setTimeout('init_iframe()',1)
}

init_iframe();
</script>
<iframe src="http://iparasol.co.kr/gnuboard4/bbs/board.php?bo_table=free_board" frameborder='0' width="100%" allowTransparency="true" name="auto_iframe" id="auto_iframe" marginwidth="0" marginheight="0" scrolling="no"></iframe>


html만 좀 하는 정도라 뭐가 문제인지 모르겠어요..
도와주시면 정말정말 감사하겠습니다ㅠ.ㅠ;;
|

댓글 3개

2013-03-24 (일) 16:24:00
http://naradesign.net/wp/2007/12/12/129/
이 코드 읽어보고 사용하세요
답변 감사합니다!!
IE와 크롬 모두 동작하는 것을 확인했습니다
다만 크롬에선 긴 글->짧은 글로 이동 할 때 높이 조절이 되지 않네요..
그냥 사용해야할지 고민이네요ㅠ
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13-03-25 조회 913
13-03-24 조회 797
13-03-24 조회 1,093
13-03-24 조회 1,700
13-03-24 조회 1,730
13-03-24 조회 1,845
13-03-24 조회 1,997
13-03-24 조회 2,762
13-03-24 조회 789
13-03-24 조회 1,838
13-03-24 조회 1,875
13-03-24 조회 970
13-03-24 조회 1,690
13-03-24 조회 2,022
13-03-24 조회 1,392
13-03-23 조회 1,894
13-03-23 조회 847
13-03-23 조회 1,148
13-03-23 조회 1,857
13-03-23 조회 938