当前行高亮的两种方法(CSS、JS)

  1. 利用CSS的hover:
table tr:hover{
    background: #00FFFF;
}
  1. 利用js的mouseover和mouseout事件:
$(document).on("mouseover",".myRow",function(){
    $(this).css({
        "background-color":"#00FFFF"
    });
});
$(document).on("mouseout",".myRow",function(){
    $(this).css({
        "background-color":"#FFFFFF"
    });
});
相关文章
相关标签/搜索