-
获取对象的绝对位置
2009-06-12
分类:
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://yourin.blogbus.com/logs/40894795.html
function CPos(x, y)
{
this.x = x;
this.y = y;
}
function GetObjPos(ATarget)
{
var target = ATarget;
var pos = new CPos(target.offsetLeft, target.offsetTop);
var target = target.offsetParent;
while (target)
{
pos.x += target.offsetLeft;
pos.y += target.offsetTop;
target = target.offsetParent;
}
return pos;
}
随机文章:
不能打开文件: mk:@MSITStore:C:\...chm无法打开CHM解决方案 2009-08-13IE中的document.getElementById() 2009-05-22Apache加载PHP.ini的顺序 2009-05-12注意大小写Hibernate 2009-03-30TSQL的count性能比较 2009-01-30
收藏到:Del.icio.us








评论