iframe高度随时调整

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
    峨眉山--文章预览
</title>
    <script type="text/javascript">
        
function SetWinHeight(obj) {
            
var win = obj;
            
if (document.getElementById) {
                
if (win && !window.opera) {
                    
if (win.contentDocument && win.contentDocument.body.offsetHeight)
                        win.height 
= win.contentDocument.body.offsetHeight;
                    
else if (win.Document && win.Document.body.scrollHeight)
                        win.height 
= win.Document.body.scrollHeight;
                }
            }
        }
    
</script>
</head>
<body>
    <iframe id='iframeTag' onload='Javascript:SetWinHeight(this)' width='100%' height='1000' frameborder='0' scrolling='no' src='Article.aspx?SysNo=64&CategorySysNo=36&type=1'></iframe>
</body>
</html>
posted @ 2012-10-11 17:35  Care健康  阅读(132)  评论(1编辑  收藏  举报
版权
作者:Bober Song

出处:http://bober.cnblogs.com

Care健康:http://www.aicareyou.com

推荐空间:华夏名网

本文首发博客园,版权归作者跟博客园共有。

转载必须保留本段声明,并在页面显著位置给出本文链接,否则保留追究法律责任的权利。