<!--StartFragment-->
<script language="javascript">
function Resize_Frame(name) {
try {
var oBody = document.frames(name).document.body;
var oFrame = document.all(name);
try {
var oBody = document.frames(name).document.body;
var oFrame = document.all(name);
tempWidth = oBody.offsetWidth-oBody.clientWidth;
oFrame.style.width = oBody.scrollWidth + tempWidth;
tempHeight = oBody.offsetHeight - oBody.clientHeight;
oFrame.style.height = oBody.scrollHeight + tempHeight;
if (oFrame.style.height == "0px" || oFrame.style.width == "0px") {
oFrame.style.width = "570px";
oFrame.style.height = "500px";
window.status = 'iframe resizing fail.';
} else {
window.status = '';
}
} catch(e) {
window.status = 'Error: ' + e.number + '; ' + e.description;
//window.status = 'No-IFrame';
}
}
</script>
oFrame.style.width = oBody.scrollWidth + tempWidth;
tempHeight = oBody.offsetHeight - oBody.clientHeight;
oFrame.style.height = oBody.scrollHeight + tempHeight;
if (oFrame.style.height == "0px" || oFrame.style.width == "0px") {
oFrame.style.width = "570px";
oFrame.style.height = "500px";
window.status = 'iframe resizing fail.';
} else {
window.status = '';
}
} catch(e) {
window.status = 'Error: ' + e.number + '; ' + e.description;
//window.status = 'No-IFrame';
}
}
</script>
<iframe omload="Resize_Frame('idBoard')" width=570 height=300 valign=top frameborder=0 src="t_board_org_admin.jsp?listID=jungbo15" name="idBoard" id=idBoard></iframe>
위와 같이 하면 된다. 단, iframe에 들어갈 페이지가 현재 iframe을 포함하고 있는 페이지와 서로 다른 머신이나 웹서버에 존재하면...엑세스가 거부되 작동이 되질 않는다...
이럴때는 어쩔 수 없이 iframe에 들어갈 페이지에 아래와 같은 스크립트를 넣어야하지만, 문제가 많다.
일단 페이지를 수정할 수 있어야하고 그 페이지가 다른 사이트에서 하나의 페이지로 존재한다면 그 페이지를 호출하면 스스로 사이징이 되버리기 때문이다...
<script language="javascript">
function resizeSelf() {
self.resizeTo(document.body.scrollWidth , document.body.scrollHeight + 10);
}
</script>
<body leftmargin="0" topmargin="0" omLoad="resizeSelf();">
'Website 세상 > Web Program' 카테고리의 다른 글
일반적으로 사용되는 포트 번호 (0) | 2008.09.09 |
---|---|
[비주얼베이직] vbsyntax (0) | 2008.09.09 |
[Javascript] Javascript syntax (0) | 2008.09.09 |
아스키코드 정리 (0) | 2008.09.09 |
아이프레임 사이즈 자동변환 (0) | 2008.09.09 |
홈페이지 접속시 바탕화면 아이콘 만들기 (BaCon) (0) | 2008.09.05 |
'시작' - '실행' 명령어. 알아두면 편리함 (0) | 2008.09.05 |
중국어사이트 개발법 정리 (0) | 2008.09.05 |
ASP / PHP Cross Reference (0) | 2008.09.05 |
메일 수신 확인 방법 (0) | 2008.09.05 |
최근댓글