hidden?
这个我不知道了
var t=0;
var l=0;
var s=src;
while(s.offsetParent){
t+=s.offsetTop;
l+=s.offsetLeft;
s=s.offsetParent;
}
alert("top="+t);alert("left="+l);

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    </head><body>
    <input type="text" name="asdf">
    <script language="JavaScript">
    <!--
    var oRect = document.all.asdf.getBoundingClientRect();alert(oRect.left)
    alert(oRect.top)
    alert(oRect.right)
    alert(oRect.bottom)
    //-->
    </script>
    </body>
    </html>
      

  2.   

    offsetLeft;
    offsetTop;
    offsetHeight;
    offsetWidth;