用jquery和css使表格颜色变化的一些代码
js $(document).ready(function(){
$("tr:has(th)").css(
{ "backgound-color":"666666","color":"white","font-size":"0.9em"}
);
$("tr:even").addClass("myeven");
$("tr:odd").addClass("myodd");
//相当于。hover 相当于mouse out 和over
$("tr:not(has(th))").hover(
function(){ $(this).addClass("mytr");},
function(){$(this).removeClass("mytr");}
);
$("td").hover(
function(){$(this).addClass("mytd");},
function(){$(this).removeClass("mytd");}
);
css .myeven{
text-align:left;
background-color:#666699;
color:white;
}
.myodd{
text-align:left;
background-color:#669999;
color:white;
}
#formOne{
padding-left:100px;
}
/* 移动上去变化的css */
.mytr{
background-color:#ff9933;
color:black;
}
.mytd{
text-align:center;
background-color:#0F0;
color:black;
}