本帖最后由 super199044 于 2011-04-12 21:39:12 编辑

解决方案 »

  1.   

    $('body').attr('scrollHeight'); 试试看
      

  2.   

    (navigator.userAgent.toLowerCase().indexOf("opera") != -1)?document.body.clientHeight:document.documentElement.clientHeight;
      

  3.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
      <script type="text/javascript">
      $(function(){
    $("#indeveloping").click(function () {
    //alert("height");
                        $("#main").append("<div id='shade'><div>");
                        var x = $(document).height();
                        alert($(document).height());
                        $("#shade").addClass("shade").animate({ opacity: .5 }, 1000).css({ "width": $(document).width(), "height": $(document).height()});
                    });
       })
      </script>
    <style type="text/css">
    #shade{
    background:blue;
    position:absolute;
    left:0px;
    top:0px;
    z-index:2000;
    }
    </style>
     </HEAD> <BODY>
    <div id="main" style="height:800px;border:1px solid red;">
       <input type="button" value="CLICKME" id="indeveloping"/>
      </div>
     </BODY>
    </HTML>
      

  4.   


    var height =(document.documentElement.scrollHeight>document.documentElement.clientHeight)?document.documentElement.scrollHeight:document.documentElement.clientHeight;试试 。