+ -
当前位置:首页 → 问答吧 → 【已解决】jq实现mouseover时tr变色的疑问

【已解决】jq实现mouseover时tr变色的疑问

时间:2010-04-28

来源:互联网

这个为啥没有效果呢?大侠帮看看,哪里出问题了,先谢啦!
复制代码
  1. <style type="text/css">
  2. .log_tb { width:860px; border-collapse:collapse; border:1px solid #92B0DD;}
  3. .log_tb th, td { background:#E2EAF8; border:1px solid #92B0DD; padding:5px 10px;}
  4. .log_tb td { background:#FAFCFD; border:1px solid #92B0DD; padding:5px 10px;}
  5. </style>
  6. <script src='./jquery.js'></script>
  7. </head>
  8. <body>
  9. <table class="log_tb" id="log_tb_list">
  10.     <tr>
  11.     <th>author</th><th>do_time</th><th>description</th>
  12.     </tr>
  13.     <tr class="list">
  14.         <td>author1</td>
  15.         <td>time1</td>
  16.         <td>description</td>
  17.     </tr>
  18. </table>
  19. <script>
  20. $(function() {
  21.     $('.list').each(function() {
  22.         $(this).mouseover(function() {
  23.             $(this).css('background-color', '#F60');
  24.         }).mouseout(function() {
  25.             $(this).css('background-color', '#CCC');
  26.         });
  27.     });
  28. });
  29. </script>
[ 此帖被spirit_mly在2010-04-28 15:47重新编辑 ]

作者: spirit_mly   发布时间: 2010-04-28

解决了

作者: spirit_mly   发布时间: 2010-04-28