http://expert.csdn.net/Expert/topic/2072/2072567.xml?temp=.7616083

解决方案 »

  1.   

    <br><br><br><br><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>
      

  2.   

    <table id=demo style="position:absolute;z-index:1000;visibility:hidden">
    <tr>
    <td>
    wwwwwwwwwwwwwwwww
    </td>
    </tr>
    </table>
      

  3.   

    我采用的是:这个
    <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>
      

  4.   

    manyou(他山之石) ( ) :你的加上这一行,同样会出现这种结果如何处理呢?
    <div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
    </div>
      

  5.   

    manyou(他山之石) ( ) :你的加上这一行,同样会出现这种结果如何处理呢?
    <div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
    </div>
      

  6.   

    这样就没问提了,OVERFLOW属性没用:
    <div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%;'>
    </div>
      

  7.   

    啊,乱码?
    这样就没问题了,OVERFLOW属性没用:
    <div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%;'>
    </div>
      

  8.   

    不能把哪一个属性去了呵,如果去了的话,div就没有滚动条了.
      

  9.   

    稍微改了一下
    <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/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>
      

  10.   

    xiaoshi(忙死了+穷死了=死定了) :不行
    <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/>
    &nbsp;&nbsp;&nbsp;sdfsadfsadfsadfasdoiasdjifsajild;fdsijskj;dlakdfj;sskldja;lk;sdfa;skljda;ksjda;jkdsaf;jksdak;lk;l;kldsaf;&nbsp;&nbsp;&nbsp;&nbsp;<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>
      

  11.   

    function DispOrHideObj(id)
    {
             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
      

  12.   

    <div width=100% height=100% style='WIDTH: 100%; HEIGHT: 100%; OVERFLOW: auto;'>
    <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>
      

  13.   

    没错错,这代码是我写的,我还是坚持我写的,你将table放到div外面