js文件
function tableTrHover(tableId) {
$("#"+tableId+">tr").hover(function() {
$(this).addClass("hover"); // 鼠标经过添加hover样式
}, function() {
$(this).removeClass("hover"); // 鼠标离开移除hover样式
})
}
页面文件
$(document).ready(tableTrHover("test"));