<br><br><br><br><br> <font onmouseover=show_div(this)>ldsfjdslfjds</font> <table> <tr> <td> <div id=demo style="position:absolute;z-index:1000;visibility:hidden">wwwwwwwwwwwwwwwww</div> </td> </tr> </table><script language="JavaScript"> <!-- function show_div(o) { var e = o var l = e.offsetLeft; var t = e.offsetTop; while(e = e.offsetParent){ l += e.offsetLeft; t += e.offsetTop; } with(demo.style){ left = l top = t+o.offsetHeight width = o.offsetWidth height = 100; border = "1px outset" visibility = visibility==''?'hidden':'' } } //--> </script>
<font onmouseover=show_div(this)>ldsfjdslfjds</font>
<table>
<tr>
<td>
<div id=demo style="position:absolute;z-index:1000;visibility:hidden">wwwwwwwwwwwwwwwww</div>
</td>
</tr>
</table><script language="JavaScript">
<!--
function show_div(o) {
var e = o
var l = e.offsetLeft;
var t = e.offsetTop;
while(e = e.offsetParent){
l += e.offsetLeft;
t += e.offsetTop;
}
with(demo.style){
left = l
top = t+o.offsetHeight
width = o.offsetWidth
height = 100;
border = "1px outset"
visibility = visibility==''?'hidden':''
}
}
//-->
</script>
<tr>
<td>
wwwwwwwwwwwwwwwww
</td>
</tr>
</table>
<br><br><br><br><br><br><br>
<br><br><br>dsfsadfasdfasdfasdfasdfasdfasdfasdf<span onclick="show(this,'table1')">测试</span>
<table border=1 id="table1" style="position:absolute;visibility:hidden">
<tr><td><a href="#" onclick="table1.style.visibility='hidden'">关闭</a></td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
</table>
<script>
function show(o,t){
var e=o;
var tt=document.getElementById(t)
var l=o.offsetLeft;
var t=o.offsetTop;
while(e=e.offsetParent){
l+=e.offsetLeft;
t+=e.offsetTop;
}
with(tt.style){
left=l
top=t+o.offsetHeight;
visibility='visible';
}
}
</script>加上层后的代码,他呢就定位不到这个字符串上了
-----------------
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
<br><br><br><br><br><br><br>
<br><br><br>dsfsadfasdfasdfasdfasdfasdfasdfasdf<span onclick="show(this,'table1')">测试</span>
<table border=1 id="table1" style="position:absolute;visibility:hidden">
<tr><td><a href="#" onclick="table1.style.visibility='hidden'">关闭</a></td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
</table>
</div>
<script>
function show(o,t){
var e=o;
var tt=document.getElementById(t)
var l=o.offsetLeft;
var t=o.offsetTop;
while(e=e.offsetParent){
l+=e.offsetLeft;
t+=e.offsetTop;
}
with(tt.style){
left=l
top=t+o.offsetHeight;
visibility='visible';
}
}
</script>
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
</div>
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
</div>
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%;'>
</div>
这样就没问题了,OVERFLOW属性没用:
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%;'>
</div>
<html>
<head>
<title>test problem </title>
<meta name=keyword content='gzg,idiotnoarea,test' >
</head>
<style>
span {cursor:hand;}
</style>
<body>
<br/><br/><br/><br/><br/>
<font onmouseover="show_div(this,'')" onmouseout="show_div(this,'none')">ldsfjdslfjds</font>
<br>
asdfasfasd
asd
asd
as
dfasd
fas
dfas
df
<table>
<tr>
<td>
<div id=demo style="position:absolute;z-index:1000;display:none">wwwwwwwwwwwwwwwww</div>
</td>
</tr>
</table><script language="JavaScript">
<!--
function show_div(o,disp) {
var e = o
var l = e.offsetLeft;
var t = e.offsetTop;
while(e = e.offsetParent){
l += e.offsetLeft;
t += e.offsetTop;
}
with(demo.style){
left = l
top = t+o.offsetHeight
width = o.offsetWidth
height = 100;
border = "1px outset"
display = disp;
}
}
//-->
</script>
</body>
</html>
<html>
<head>
<title>test problem </title>
<meta name=keyword content='gzg,idiotnoarea,test' >
</head>
<div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
<style>
span {cursor:hand;}
</style>
<body>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
sdfsadfsadfsadfasdoiasdjifsajild;fdsijskj;dlakdfj;sskldja;lk;sdfa;skljda;ksjda;jkdsaf;jksdak;lk;l;kldsaf; <font onmouseover="show_div(this,'')" onmouseout="show_div(this,'none')">找不着了</font>
<br>
asdfasfasd
asd
asd
as
dfasd
fas
dfas
df
</div>
<table>
<tr>
<td>
<div id=demo style="position:absolute;z-index:1000;display:none">wwwwwwwwwwwwwwwww</div>
</td>
</tr>
</table><script language="JavaScript">
<!--
function show_div(o,disp) {
var e = o
var l = e.offsetLeft;
var t = e.offsetTop;
while(e = e.offsetParent){
l += e.offsetLeft;
t += e.offsetTop;
}
with(demo.style){
left = l
top = t+o.offsetHeight
width = o.offsetWidth
height = 100;
border = "1px outset"
display = disp;
}
}
//-->
</script>
</body>
</html>
{
var id = document.all(id);
if (id.style.display == '')
{
id.style.display = 'none'; }
else
{
id.style.display = ''; }
}
<span onclick="DispOrHideObj(id1)">String</span>
<table id="id1" style="none">
</table
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/>dsfsadfasdfa<br>sdfasdfasdfasdfasdfasdf<span onclick="show(this,'table1')">测试</span>
<table border=1 id="table1" style="position:absolute;visibility:hidden">
<tr><td><a href="#" onclick="table1.style.visibility='hidden'">关闭</a></td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td></tr>
</table>
</div>
<script>
function show(o,t){
var e=o;
var tt=document.getElementById(t)
var l=o.offsetLeft;
var t=o.offsetTop;
// while(e=e.offsetParent){
// l+=e.offsetLeft;
// t+=e.offsetTop;
//}
with(tt.style){
left=l
top=t+o.offsetHeight;
visibility='visible';
}
}
</script>