Board logo

标题: 取得控件得绝对位置 [打印本页]

作者: fangzhen    时间: 2008-12-1 12:42     标题: 取得控件得绝对位置

<script language="javascript">
function getoffset(e)
{
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent)
{
t+=e.offsetTop;
l+=e.offsetLeft;
}
var rec = new Array(1);
rec[0] = t;
rec[1] = l;
return rec
}
</script>

oRect = obj.getBoundingClientRect();
oRect.left
oRect.




欢迎光临 PHP开发笔记 (http://phpvi.com/) Powered by Discuz! 6.1.0