2014-10-29 106 views
0

我使用jquery插件数据表显示我的数据,它工作正常,我从我的数据从php使用AJAX, 但我有一个问题,当我想突出显示的时候移动桌子。它不起作用。但是当我在其他表中使用脚本时,它可以工作。我在Chrome控制台中暂停了一些代码,它工作正常,我很困惑,我该如何解决这个问题。 这里的脚本:突出hquery行jquery插件datatable

<script type="text/javascript"> 
$(document).ready(function() { 
    $('#example').dataTable({ 
        "bProcessing": true, 
        "sAjaxSource": "testConn2008.php", 
        "bAutoWidth": true, 
        "aoColumns": [ 
          { mData: '\u533a\u57df' } , 
          { mData: '\u6708\u4efd' }, 
          { mData: '\u7535\u8111\u7f16\u53f7' }, 
          { mData: '\u7528\u6237\u518c\u53f7' } , 
          { mData: '\u6c34\u8868\u7c7b\u578b' } 
        ] 
      }); 
}); 
</script> 
    <script type="text/javascript"> 
    $(document).ready(function() { 
     $("#example tbody tr").mouseover(function() { 
        $(this).addClass("over"); 
      }); 
     $("#example tbody tr").mouseout(function() { 
        $(this).removeClass("over"); 
      }); 

    }); 
    </script> 
    <style type="text/css"> 
    tr.over td{ 
background: #D6E8F8; 
font-weight: bold; 
} 
    </style> 

回答

0

我想知道你为什么要使用jQuery。简单的CSS你可以做到这一点。

#example td:hover 
{ 
    background: #D6E8F8; 
    font-weight: bold; 
}