请教各位高人!! Sorry!!如何得到网页中的一个表格距离浏览器顶端的高度?thks! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title><script language="Javascript">function getIE(e){ var t=e.offsetTop; var l=e.offsetLeft; while(e=e.offsetParent){ t+=e.offsetTop; l+=e.offsetLeft; } alert("top="+t+"\nleft="+l); }</script></head><body><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><table width="50%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666"> <tr bgcolor="#A6AE8C"> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> </tr> <tr bgcolor="#A6AE8C"> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> </tr> <tr bgcolor="#A6AE8C"> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> </tr> <tr bgcolor="#A6AE8C"> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> </tr> <tr bgcolor="#A6AE8C"> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> <td onClick="getIE(this);"> </td> </tr> </table></td> </tr></table></body></html> 只能是在页面这个范围内,显示范围.如果加入工具栏,地址栏的话,不行.因为,不同浏览器,Myie,腾讯TT.这些工具栏,地址栏长度不一样.<body>000<table id="tb"><tr><td>灰豆宝宝.net</td></tr></table><input type=button onclick="get()" value="get"><script>function get(){ var bao = tb.offsetTop; bao += document.body.clientTop; alert(bao)}</script></body> 求助如何用js实现表单大学列表功能 一组图片导航中图片的切换效果? 关于控件的绝对位置 求助一个简单问题 在网上找的这个消息提示代码,在关闭的时候要出未知错误,谁能帮我看看? 有没有带搜索功能的下拉框的插件 用showModalDialog打开一个jsp,数据怎么处理 打开一个窗口,10秒后关掉这个窗口 在线等!! 表格如何增加一列?或者一行? 如何在js中调用asp或 jsp的程序? 打开一个新窗口时,如何使新打开窗口右上角的关闭按纽不可用,即是灰色的 父窗口如何向子窗口传递参数???
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="Javascript">
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"\nleft="+l);
}
</script>
</head><body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="50%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#A6AE8C">
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
</tr>
<tr bgcolor="#A6AE8C">
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
</tr>
<tr bgcolor="#A6AE8C">
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
</tr>
<tr bgcolor="#A6AE8C">
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
</tr>
<tr bgcolor="#A6AE8C">
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
<td onClick="getIE(this);"> </td>
</tr>
</table></td>
</tr>
</table></body>
</html>
如果加入工具栏,地址栏的话,不行.因为,不同浏览器,Myie,腾讯TT.
这些工具栏,地址栏长度不一样.<body>
000
<table id="tb">
<tr><td>灰豆宝宝.net</td></tr>
</table>
<input type=button onclick="get()" value="get">
<script>
function get()
{
var bao = tb.offsetTop;
bao += document.body.clientTop;
alert(bao)
}
</script>
</body>