如何取得网页中某个元素的坐标啊

arrowssystems 2003-12-22 11:22:29
如何取得网页中某个元素的坐标啊
...全文
104 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
a_zhe_20 2003-12-22
  • 打赏
  • 举报
回复
不好意思,具体我也不清楚了:(
arrowssystems 2003-12-22
  • 打赏
  • 举报
回复
谢谢a_zhe_20(努力学习是为了找工作) 。
你的方法在IE6.0和NC7.X中通过了,虽然显示的值不一样,可能是窗口的边框的值有没有加上的问题。
但是NC4.X没有通过,还是说没有定义。
能不能再指点一下。
a_zhe_20 2003-12-22
  • 打赏
  • 举报
回复
<input type="text" name="text1">
<input type="button" name="button" onclick="temp()">
<script>
function temp()
{
alert("left1:"+text1.offsetLeft);
alert("top:"+text1.offsetTop);
}
</script>
flyingding 2003-12-22
  • 打赏
  • 举报
回复
你若是没在css中设定, a_zhe_20(努力学习是为了找工作)的方法是用不起来的
arrowssystems 2003-12-22
  • 打赏
  • 举报
回复
楼上的不行啊。说left,top undefined啊。
a_zhe_20 2003-12-22
  • 打赏
  • 举报
回复
<input type="text" name="text1">
<input type="button" name="button" onclick="temp()">

function temp()
{
alert("left:"+document.all.text1.left);
alert("top:"+document.all.text1.top);
}

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧