jquery
实现的效果:隔行变色
“`
var _this =(this); //设置偶数行和奇数行颜色 _this.find("tr:even").css("background-color", "#d8ebfa");//奇数行 _this.find("tr:odd").css("background-color", "#f0f0f0"); //鼠标移动隔行变色hover用法关键 _this.find("tr:not(:first)").hover(function () { (this).attr("bColor", (this).css("background-color")).css("background-color", "#E0E0E0").css("cursor", "pointer"); }, function () { (this).css("background−color", (this).attr("bColor")); }); }); }