使用jquery在悬停上添加背景颜色和边框到表格行

有没有人知道如何在鼠标悬停在行上时将边框添加到具有不同背景颜色的表格行的边框?

我已经能够改变行的背景颜色:

$(document).ready(function() {
   $(function() {
        $('.actionRow').hover(function() {
            $(this).css('background-color','#FFFF99');
        },function() {
            $(this).css('background-color','#FFFFFF');
        });
    });
});

但是我无法添加边框颜色.我意识到边框不能直接应用到表行标签,但我希望有人知道一些jQuery巫术魔法,可以在所选行中找到表格单元格,并为创建边框应用一些样式.

谢谢!

解决方法

$(function() {
        $('tr').hover(function() {
            $(this).css('background-color','#FFFF99');
            $(this).contents('td').css({'border': '1px solid red','border-left': 'none','border-right': 'none'});
            $(this).contents('td:first').css('border-left','1px solid red');
            $(this).contents('td:last').css('border-right','1px solid red');
        },'#FFFFFF');
            $(this).contents('td').css('border','none');
        });
    });

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...