清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
一、隔行换色
$("tr:odd").css("background-color","#eeeeee"); $("tr:even").css("background-color","#ffffff");
$("table tr:nth-child(odd)").css("background-color","#eeeeee");
:nth-child 匹配其父元素下的第N个子或奇偶元素
二、鼠标经过变色$("tr").live({ mouseover:function(){ $(this).css("background-color","#eeeeee"); }, mouseout:function(){ $(this).css("background-color","#ffffff"); } })
$("tr").bind("mouseover",function(){ $(this).css("background-color","#eeeeee"); }) $("tr").bind("mouseout",function(){ $(this).css("background-color","#ffffff"); })