- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <style type="text/css">
- .hover
- {
- color:#fff;
- background-color:#f00;
- }
- </style>
- <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $('tr').hover(function () {
- $(this).find('td').addClass('hover');
- }, function () {
- $(this).find('td').removeClass('hover');
- }
- )
- });
- </script>
- </head>
- <body>
- <table border="1">
- <thead>
- <tr>
- <th>ID</th><th>Name</th><th>Mark</th>
- </tr>
- <tr><td>100</td><td>Steven</td><td>100</td></tr>
- <tr><td>101</td><td>Mike</td><td>70</td></tr>
- <tr><td>102</td><td>Robot</td><td>80</td></tr>
- </thead>
- </table>
- </body>
- </html>
当鼠标悬点时,突出当前行
最新推荐文章于 2024-08-11 13:42:16 发布