|
|
| |
´Ù¸¥ µµ¸ÞÀΰ£ iframe Å©±â ÀÚµ¿Á¶Àý |
|
|
|
12³â Àü
|
a.comÀ̶ó´Â µµ¸ÞÀο¡¼ b.comÀÇ b.htmlÀ» ºÒ·¯¿Ã¶§.. Å©±â¸¦ ÀÚµ¿À¸·Î Á¶ÀýÇϱâ À§ÇÑ ¹æ¹ýÀÔ´Ï´Ù.
¸ÕÀú a¶ó´Â ȨÆäÀÌÁö¿¡ auto_size.htmlÀ» ¸¸µì´Ï´Ù.
====================== auto_size.html - a.com =========================
<html>
<head>
<title>Resizing Page</title>
<script type="text/javascript">
function onLoad() {
var params = window.location.search.substring( 1 ).split( '&' );
var height;
for( var i = 0, l = params.length; i < l; ++i ) {
var parts = params[i].split( '=' );
switch( parts[0] ) {
case 'height':
height = parseInt( parts[1] );
break;
}
}
if( typeof( height ) == 'number' ) {
window.top.updateIFrame( height );
}
}
window.onload = onLoad;
</script>
</head>
<body>
<p>Resizing IFrame...</p>
</body>
</html>
=======================================================
±×¸®°í a¶ó´Â ȨÆäÀÌÁö¿¡¼ ¸µÅ©ÇÒ ¹®¼¿¡´Â ¾Æ·¡¿Í °°ÀÌ »ðÀÔÇÕ´Ï´Ù.
======================= a.html - a.com ===================
<script type="text/javascript">
function updateIFrame( height ) {
var iframe = document.getElementById( 'myiframe' );
iframe.setAttribute( 'height', height );
}
</script>
http://b.com/b.html" scrolling=no frameborder=0 width="600" height="600">
ÀÌÁ¦ b¶ó´Â µµ¸ÞÀÎÀÇ b.html¿¡´Â ¾Æ·¡¿Í °°ÀÌ »ðÀÔÇÕ´Ï´Ù.
================== b.html - b.com============================
<style>
#inneriframe { position : absolute; top : 0px; left : 0px; visibility: hidden; }
</style>
<script type="text/javascript">
function rsize() {
var iframe = document.getElementById( 'inneriframe' );
var wrapper = document.getElementById( 'wrapper' );
var height = Math.max( document.body.offsetHeight, document.body.scrollHeight );
iframe.src = 'http://a.com/auto_size.html?height='+height; }
</script>
<body onload=rsize(); >
<div id=wrapper>
³»¿ë
</div>
<iframe id="inneriframe" width="10" height="10"></iframe>
</body>
|
|
̵̧ : 735 |
̵̧
¸ñ·Ï
|
|
| |
|