<style>
.hover {
background-color: #ff0000;
}
</style>
方法1:
$(document).ready(function () {
$("tr").bind("mouseover", function () {
$(this).css("background-color", "#eeeeee");
})
$("tr").bind("mouseout", function () {
$(this).css("background-color", "#ffffff");
})
}); 方法2:
$(document).ready(function () {
$("tr").bind("mouseover", function () {
$(this).addClass("hover");
})
$("tr").bind("mouseout", function () {
$(this).removeClass("hover");
})
});