js获取table中td的绝对坐标
2006-12-18 17:51
253 查看
我的免费电影网站一:http://www.foxwow.com
我的免费电影网站二:http://www.91free.org
方法1:
function getAbsPoint(e)
{
var x = e.offsetLeft, y = e.offsetTop;
while(e=e.offsetParent)
{
x += e.offsetLeft;
y += e.offsetTop;
}
alert("x:"+x+","+"y:"+y);
}
方法2:
function getAbsPoint(obj)
{
var x,y;
oRect = obj.getBoundingClientRect();
x=oRect.left
y=oRect.top
alert("("+x+","+y+")")
}
JS中获得窗口属性的方法
1。获得屏幕的分辨率:
screen.width
screen.height
2。获得窗口大小:
document.body.clientWidth
document.body.clientHeight
3。获得窗口大小(包含Border、Scroll等元素)
document.body.offsetWidth
document.body.offsetHeight
http://p.blog.csdn.net/images/p_blog_csdn_net/yicel/263904/o_08_193405_b91edhtmlpos.gif" border="0" >
我的免费电影网站二:http://www.91free.org
方法1:
function getAbsPoint(e)
{
var x = e.offsetLeft, y = e.offsetTop;
while(e=e.offsetParent)
{
x += e.offsetLeft;
y += e.offsetTop;
}
alert("x:"+x+","+"y:"+y);
}
方法2:
function getAbsPoint(obj)
{
var x,y;
oRect = obj.getBoundingClientRect();
x=oRect.left
y=oRect.top
alert("("+x+","+y+")")
}
JS中获得窗口属性的方法
1。获得屏幕的分辨率:
screen.width
screen.height
2。获得窗口大小:
document.body.clientWidth
document.body.clientHeight
3。获得窗口大小(包含Border、Scroll等元素)
document.body.offsetWidth
document.body.offsetHeight
![]( <a href='http://p.blog.csdn.net/images/p_blog_csdn_net/yicel/263904/o_08_193405_b91edhtmlpos.gif)
相关文章推荐
- JS获取table中td的绝对坐标
- js获取table中td的绝对坐标(HTML元素定位)
- [转]js获取table中td的绝对坐标
- js获取对象的绝对坐标
- JS 获取Table中td值
- JS获取Table中td值的方法
- js 获取table tr td内的select 和input text
- js中获取 table节点各tr及td的内容方法
- 用js(jQuery)获取table中对应的td中的值!
- [转载]获取html绝对坐标 屏蔽Ctrl+V 按回车键直接登录 js代码 .
- js随笔,css和js禁止网页选择文本,table的class样式使得td的class样式失效,jquery获得元素坐标
- js获取触发事件元素在整个网页中的绝对坐标(示例代码)
- js获取触发事件元素在整个网页中的绝对坐标(示例代码)
- js中获取 table节点各tr及td的内容简单实例
- js获取对象的绝对坐标
- js中获取 table节点各tr及td的内容方法
- js中获取 table节点各tr及td的内容方法
- js获取table下的tr和td,并且设置某个td里的文字样式
- js从table的当前位置获取当前行的元素和td中的前后元素
- js随笔,css和js禁止网页选择文本,table的class样式使得td的class样式失效,jquery获得元素坐标