iframe size 동적으로 맞추기

script 2013. 4. 27. 13:09

* iframe.jsp

 

<script type="text/javascript">
function isLoad() {
    var frameName = window.name;
    var frameHeight = document.body.scrollHeight;

    try {
         parent.document.getElementById(frameName).style.height = frameHeight + "px";
    } catch(e) {}
 }

</script>

<body onLoad="isLoad()">
================================================================================

* read.jsp

<iframe name="frameName" id="frameName" src="iframe.jsp" scrolling="no">

Trackbacks 0 : Comments 0

Write a comment