$("table").delegate("tr", "mouseover", function () { //$(this).addClass("tr-mouseover") $(this).css("background-color", "AliceBlue"); }); $("table").delegate("tr", "mouseout", function () { //$(this).removeClass("tr-mouseover"); $(this).css("background-color",""); });
语法css
$(selector).delegate(childSelector,event,data,function)