asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> 取得鼠标所在位置的对象 </TITLE>
<META NAME="Author" CONTENT="宝玉 [url]http://www.nwpubbs.net[/url]">
</HEAD>
<script language="javascript">
    <!--
 function fnGetTable( oEl )
    {
  try{
   while( null != oEl && oEl.tagName!="TABLE" )
   {
    oEl = oEl.parentElement;
   }
   return oEl;
  }
  catch(e)
  {
   return null;
  }
    }
 function pos()
 {
  try{
  oElement = document.elementFromPoint(event.x,event.y);
  oElement = fnGetTable(oElement);
  if(oElement.tagName=="TABLE")
   show.innerText=oElement.id;
  }
  catch(e)
  {}
    }
 // -->
</script>
<BODY onmousemove="pos()">
<table border="1" cellpadding="" cellspacing="" width="" id="table1">
<tr>
 <td>table1</td>
</tr>
</table>
<table border="1" cellpadding="" cellspacing="" width="" id="table2">
<tr>
 <td>table2</td>
</tr>
</table>
<table border="1" cellpadding="" cellspacing="" width="" id="table3">
<tr>
 <td>table3</td>
</tr>
</table>
<table border="1" cellpadding="" cellspacing="" width="" id="table4">
<tr>
 <td>table4</td>
</tr>
</table>
<table border="1" cellpadding="" cellspacing="" width="" id="table5">
<tr>
 <td>table5</td>
</tr>
</table>
<table border="1" cellpadding="" cellspacing="" width="" id="table6">
<tr>
 <td>table6</td>
</tr>
</table>
鼠标当前在:<span id="show"></span>
</BODY>
</HTML>
posted on 2006-04-03 15:54 汪杰 阅读(437) 评论(0)  编辑 收藏 引用 所属分类: hengxing网站js
只有注册用户登录后才能发表评论。

<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 456687
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜