css一般的表格样式

 1   <script type="text/javascript">
 2         $(function () {
 3             //单击选中
 4             $('.sorttablebody tr').click(function () {
 5                 $(this).addClass('trSel');
 6             });
 7 
 8             //单击选中,再单击其他行,该行取消选中
 9             $('.sorttablebody tr').click(function () {
10                 $('.sorttablebody tr').attr("class", "");
11                 $(this).addClass('trSel');
12             });
13             $('.sorttablebody tr').toggle(
14                  function () {
15                      $(this).addClass('trSel');
16                  },
17                 function () {
18                     $(this).removeClass('trSel');
19                 }
20              );
21 
22 
23             $(function () {
24                 //光棒
25                 $('tr').hover(
26                     function () {
27                         $(this).addClass('on');
28                     },
29                     function () {
30                         $(this).removeClass('on');
31                     }
32              );
33                 //单击选中,再单击该行取消选中
34                 $('tr').toggle(
35                         function () {
36                             $(this).css('background', '#FC6');
37                         },
38                         function () {
39                             $(this).css('background', '');
40                         }
41                     );
42             });
43         });
44 
45     </script>
onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='blue'" onmouseout="this.style.backgroundColor=currentcolor"

 

posted on 2013-07-24 11:18  都是脚本惹的祸  阅读(205)  评论(0编辑  收藏  举报

导航