如何去掉frame里面的滚动条,让其自动适应大小

2025-05-20 02:59:14
推荐回答(1个)
回答1:

function SetCwinHeight(obj) {
            var cwin = obj;
            if (document.getElementById) {
                if (cwin && !window.opera) {
                    if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
                        cwin.height = cwin.contentDocument.body.offsetHeight + 20; //FF NS
                    else if (cwin.Document && cwin.Document.body.scrollHeight)
                        cwin.height = cwin.Document.body.scrollHeight + 10; //IE
                }
                else {
                    if (cwin.contentWindow.document && cwin.contentWindow.document.body.scrollHeight)
                        cwin.height = cwin.contentWindow.document.body.scrollHeight; //Opera
                }
            }
        }