 |
|
|  |
iframeÀÇ ³ôÀ̸¦ ³»¿ë¿¡ ¸Â°Ô ÀÚµ¿À¸·Î ¸ÂÃçÁÖ´Â ÇÔ¼ö |
|
|
 |
15³â Àü |
/* iframe Resizing
ÀͽºÇ÷η¯ 6, ³Ý½ºÄÉÀÌÇÁ 8 À̻󿡼 ÀÛµ¿
³Êºñ´Â Àû¿ë¾ÈµÇ°í ³ôÀ̸¸ ÀÚµ¿ ¸®»çÀÌÁî
Ex)
<iframe src="ÁÖ¼Ò" width="640" marginwidth="0" marginheight="0" frameborder="0" onLoad="ResizeIFrame(this);"></iframe>
*/
function resizeIFrame(iframeId)
{
try {
var innerBody = iframeId.contentWindow.document.body;
var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
if(iframeId.style.height != innerHeight) {
iframeId.style.height = innerHeight;
}
if(document.all) {
innerBody.attachEvent('onclick',parent.do_resize);
innerBody.attachEvent('onkeyup',parent.do_resize);
}
else {
innerBody.addEventListener("click", parent.do_resize, false);
innerBody.addEventListener("keyup", parent.do_resize, false);
}
}
catch (e) {
}
}
====================================================================
ÀÌ·¸°Ô ÇÏ¿©µµ µË´Ï´Ù.
<!-- ¾ÆÀÌÇÁ·¹ÀÓ Ã¢ ³ôÀÌ Á¶Àý ½ÃÀÛ -->
<script language="JavaScript">
<!--
function calcHeight() {
//find the height of the internal page
var the_height=
document.getElementById('iframe').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('iframe').height=
the_height;
}
//-->
</script>
<!-- ¾ÆÀÌÇÁ·¹ÀÓ Ã¢ ³ôÀÌ Á¶Àý ³¡ -->
¿©±â±îÁö¸¦ <head>¿Í </head>»çÀÌ¿¡ ³ÖÀ¸½Ã°í
°Ô½ÃÆÇÀ» »ðÀÔÇÏ´Â °÷¿¡´Â
<!--- °Ô½ÃÆÇ »ðÀÔ ½ÃÀÛ -->
<?
echo "<iframe id=iframe onLoad=\"calcHeight();\" src=\"¿©±â¿¡ °Ô½ÃÆÇ ÁÖ¼Ò¸¦ ³ÖÀ¸¼¼¿ä\" scrolling=no frameborder=0 width=1000 height=0></iframe>";
?>
<!--- °Ô½ÃÆÇ »ðÀÔ ---> |
|
̵̧ : 491 |
̵̧
¸ñ·Ï
|
|
|  |
|