2022-04-19 帆软 鼠标移入表格显示颜色代码

绑在body的初始化后js事件上。

setTimeout(function() {
        //选择时背景颜色变量  
        var oldColor = "rgb(255, 255, 255)";
        var newColor = "rgb(230, 247, 255)";

        $('.x-table td').hover(function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', newColor).siblings().css("background", newColor);
                }
        }, function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', oldColor).siblings().css("background", oldColor);
                }
        });
}, 1000);

改变字体大小,行高

setTimeout(function() {
        //选择时背景颜色变量  
        var oldColor = "rgb(255, 255, 255)";
        var newColor = "rgb(230, 247, 255)";

        $('.x-table td').hover(function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', newColor).siblings().css("background", newColor);
                        $(this).css("font-size", 16).siblings().css("font-size", 16);
                        $(this).css("height", 28).siblings().css("height", 28);
                }
        }, function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', oldColor).siblings().css("background", oldColor);
                        $(this).css("font-size", 12).siblings().css("font-size", 12);
                        $(this).css("height", 20).siblings().css("height", 20);
                        
                }
        });
}, 1000);

加粗字体

setTimeout(function() {
        //选择时背景颜色变量  
        var oldColor = "rgb(255, 255, 255)";
        var newColor = "rgb(200, 204, 255)";

        $('.x-table td').hover(function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', newColor).siblings().css("background", newColor);
                        $(this).css("font-weight", 700).siblings().css("font-weight", 700);

                }
        }, function() {
                if ($(this).attr("style").indexOf("background-color") == -1) {
                        $(this).css('background', oldColor).siblings().css("background", oldColor);
                        $(this).css("font-weight", 400).siblings().css("font-weight", 400);     
                }
        });
}, 1000);

改变筛选条件以后如果这个效果失效了,需要在改变条件的控件加编辑结束事件粘贴进效果代码。参数面板的筛选条件不用,改变参数面板会重新渲染body

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值