zoukankan
html css js c++ java
javascript 获取控件的绝对位置
调用方法:
var pos=GetObjPos(ID);
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;
}
查看全文
相关阅读:
UIImageView
正则表达式
控制器生命周期和 UIView
Storyboard
1218.2——property关键字
1218.1——OC中的常见关键字及一些基本方法
1217.2——定义一个类+方法声明调用
1217.1——OC准备
1216.2——文件操作
1216.1——双链表
原文地址:https://www.cnblogs.com/ringwang/p/1125098.html
最新文章
图片无限滚动
NSTimer简介
Reverse linked list(逆转从n到m处的单链表)--leetcode
磁盘调度算法
gnuplot进阶
@property 和@synthesize
02-基本线条绘制
数据的存储
transform的使用
字符串属性使用strong的原因
热门文章
OC基础(26)
OC基础(25)
OC基础(24)
OC基础(23)
UIApplication类
UILayer
UIView动画与拉伸图片
UILabel---.tff格式字体
单例模式
KVC与KVO
Copyright © 2011-2022 走看看