- 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;
- }
获取控件的绝对位置(该控件非position:absolute)
最新推荐文章于 2024-07-21 20:14:06 发布