最近项目做一个当鼠标移动到TABLE上就弹出新窗口显示详细信息,移开鼠标就关闭,我就是在TABLE上用onMouseover和onMouseout来做,但现在遇到一个问题就是当鼠标移到TABLE上时onMouseover和onMouseout会同时触发,今天一天都是这个问题 ,不知道该怎么解决,请各位高手帮个忙,谢了

解决方案 »

  1.   

    <table id='jsxx' onMouseover="show()" onMouseout="destroy()"  >
    就是这样的
      

  2.   

    table上面是否有其他的元素遮挡?
      

  3.   

    这个TABLE外面还有一个大的TABLE包围,这个TABLE是在大TABLE的TD里面的
      

  4.   

    以前好像碰到在ie6下面有此诡异发生, 把 onMouseover 换成 onmousemove 试试.
      

  5.   


    <script>
    if(typeof(HTMLElement)!="undefined")
    HTMLElement.prototype.contains=function(obj){
    if(obj==this)return true;
    while(obj=obj.parentNode) if(obj==this)return true;
    return false;
    } function show(e){
    var e = window.event?window.event:e;
    var obj = e.srcElement||e.target;
    var tb = document.getElementById('jsxx');
    if(tb == obj) document.getElementById('pad').style.visibility = "visible";
    }
    function destroy(e){
    var e = window.event?window.event:e;
    var obj = e.toElement||e.relatedTarget;
    var tb = document.getElementById('jsxx');
    if(!tb.contains(obj)) document.getElementById('pad').style.visibility = "hidden";
    }</script>
    <table id='jsxx' border="1" onMouseover="show(event)" onMouseout="destroy(event)" >
    <tr><td>xxx</td><td>xxx</td></tr>
    <tr><td>xxx</td><td>xxx</td></tr>
    </table><div id="pad" style="visibility:hidden"> window </div>
      

  6.   

    onmousemove 和onmouseover有什么区别吗
      

  7.   


    onmouseover 时间会在鼠标指针移动到指定的对象上时发生。onmousemove 事件会在鼠标指针移动时发生。