document.getElementById('lay').scrollHeight

解决方案 »

  1.   

    Sorry, should be Document but not document:)
      

  2.   

    <script language=javascript>
    function getIE(e){
    var t=e.offsetTop;
    var l=e.offsetLeft;
    var height=e.clientHeight;
    while(e=e.offsetParent){
    t+=e.offsetTop;
    l+=e.offsetLeft;
    }
    alert("top="+t+"/nleft="+l);
    alert("下边界为"+(parseInt(t)+height));
    }
    f()
    {
    getIE(document.getElementById('lay'))
      document.getElementById('lay').clientHeight;//请问alert里面怎么写呀?需要传什么参数,谢谢高人指教!!
    }
    </script>
      

  3.   

    function f()
    {
        var div=document.getElementById("lay");
        alert("top="+div.offsetTop+";left="+div.offsetLeft);
    }
    </script><div id="lay" style="position:absolute; left:10px; top:100px;width:100px;height:50px; border:1px solid #000; background-color:#F00" onclick="f()"></div>
      

  4.   

    function f()
    {
        var div=document.getElementById("lay");
        alert("top="+div.offsetTop+";height="+div.offsetHeight);
    }
    </script>
      

  5.   

    谢谢大大们~!!!!!感动ing~~~
      

  6.   

    http://blog.csdn.net/epbon/archive/2006/01/11/576674.aspx
    里面有详细介绍,附图说明