main.php
<iframe src="<?php echo ROOT_PATH; ?>/iframe_include/iframetab.php" id="IframeId" name="IframeId" scrolling="no" width="100%"></iframe>
iframetab.php
...
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
결과보기
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
...
<script type="text/javascript">
var docHeight = 0;
function resizeIframe() {
if (typeof document.height != 'undefined') {
docHeight = document.height;
}
else if (document.compatMode && document.compatMode != 'BackCompat') {
docHeight = document.documentElement.scrollHeight;
}
else if (document.body && typeof document.body.scrollHeight != 'undefined') {
docHeight = document.body.scrollHeight;
}
// magic number: suppress generation of scrollbars...
//docHeight += 20;
parent.document.getElementById('IframeId').style.height = docHeight + "px";
}
parent.document.getElementById('IframeId').onload = resizeIframe;
parent.window.onresize = resizeIframe;
$('#collapseOne').on("hidden.bs.collapse", function(){
//trigger content change
//this code will be triggered when the collapse transition is completed
//that is your myCollapsible element will have 'in' in your class
resizeIframe();
//alert(docHeight);
});
</script>
$('#collapseTwo').on("shown.bs.collapse", function(){
//trigger content change
//this code will be triggered when the collapse transition is completed
//that is your myCollapsible element will have 'in' in your class
resizeIframe();
//alert(docHeight);
});
iframe 학습중인데 좀 배워보게요
답하는거도 맨땅에 헤딩하라는 건가요? ㅋㅋㅋ