JS
2011. 6. 17. 09:39
function autoResize(i){//i 는 document 의 element(iframe)
try {
var st = document.getElementById("contentFrame");
var iframeHeight= i.contentWindow.document.body.scrollHeight;
var iframeWidth= i.contentWindow.document.body.scrollWidth;
(i).height=iframeWidth+20;
(i).height=iframeHeight+20;
} catch (e) {
var st = document.getElementById("contentFrame");
var iframeHeight= st.document.body.scrollHeight;
var iframeWidth= st.document.body.scrollWidth;
st.height=iframeWidth+20;
st.height=iframeHeight+20;
}
try {
var st = document.getElementById("contentFrame");
var iframeHeight= i.contentWindow.document.body.scrollHeight;
var iframeWidth= i.contentWindow.document.body.scrollWidth;
(i).height=iframeWidth+20;
(i).height=iframeHeight+20;
} catch (e) {
var st = document.getElementById("contentFrame");
var iframeHeight= st.document.body.scrollHeight;
var iframeWidth= st.document.body.scrollWidth;
st.height=iframeWidth+20;
st.height=iframeHeight+20;
}