限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

jquery根据table表格数值大小设置单元格背景色插件

所属分类: 网页特效-其它&杂项    2023-11-28 05:10:10

jquery根据table表格数值大小设置单元格背景色插件 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery根据table表格数值大小设置单元格背景色插件(共3个文件)

    • index.html

使用方法

  • code
  • source
  1. $(document).ready(function(){
  2. Array.max = function(array){
  3. return Math.max.apply(Math,array);
  4. };
  5. var counts= $('.heat-map tbody td').not('.stats-title').map(function() {
  6. return parseInt($(this).text());
  7. }).get();
  8. var max = Array.max(counts);
  9. console.log(counts);
  10. console.log(max);
  11. n = 90;
  12. xr = 255; // Red value
  13. xg = 255; // Green value
  14. xb = 255; // Blue value
  15. //User Defined Color
  16. yr = 143; // Red value
  17. yg =72; // Green value
  18. yb = 117; // Blue value
  19. $('.heat-map tbody td').not('.stats-title').each(function(){
  20. var val = parseInt($(this).text());
  21. console.log(val);
  22. var pos = parseInt((Math.round((val/max)*80)).toFixed(0));
  23. console.log(pos);
  24. red = parseInt((xr + (( pos * (yr - xr)) / (n-15))).toFixed(0));
  25. console.log(red);
  26. green = parseInt((xg + (( pos * (yg - xg)) / (n-15))).toFixed(0));
  27. console.log(green);
  28. blue = parseInt((xb + (( pos * (yb - xb)) / (n-15))).toFixed(0));
  29. console.log(blue);
  30. clr = 'rgb('+red+','+green+','+blue+')';
  31. console.log(clr);
  32. $(this).css({backgroundColor:clr});
  33. });
  34. });
$(document).ready(function(){
        Array.max = function(array){
        return Math.max.apply(Math,array);
    };

    var counts= $('.heat-map tbody td').not('.stats-title').map(function() {
        return parseInt($(this).text());
    }).get();
    
    var max = Array.max(counts);
    console.log(counts);
    console.log(max);
    n = 90; 

    xr = 255; // Red value
    xg = 255; // Green value
    xb = 255; // Blue value
 
  //User Defined Color
    yr = 143; // Red value
    yg =72; // Green value
    yb = 117; // Blue value
 
  
    $('.heat-map tbody td').not('.stats-title').each(function(){
        var val = parseInt($(this).text());
        console.log(val);
        var pos = parseInt((Math.round((val/max)*80)).toFixed(0));
        console.log(pos);
        red = parseInt((xr + (( pos * (yr - xr)) / (n-15))).toFixed(0));
        console.log(red);
        green = parseInt((xg + (( pos * (yg - xg)) / (n-15))).toFixed(0));
        console.log(green);
        blue = parseInt((xb + (( pos * (yb - xb)) / (n-15))).toFixed(0));
        console.log(blue);
        clr = 'rgb('+red+','+green+','+blue+')';
        console.log(clr);
        $(this).css({backgroundColor:clr});
    });
});

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 其它&杂项

jquery动态获取github自定义数据回显插件

这是一个面向开发人员的jQuery插件,它可获取你的Github存储库,并在你的网页上以优雅的自定义数据列表的形式显示出来。
  其它&杂项
 7350  0

jquery图片上增加定位注释文字提示插件

一款可在图片上自定义添加标注注释提示信息插件,适用于新增模块介绍及广告位置信息。
  其它&杂项
 8361  0

jquery公告栏标题定时切换的轮播特效

一款带箭头可上下切换的公告标题,默认自动切换,鼠标hover不执行切换。
  其它&杂项
 8346  0

原生js实用的在线计算器代码下载

一款原生js编写的计算器,跟实际当中的无异,非常实用!
  其它&杂项
 4402  0

评论数(2) 回复有机会获得K币 用户协议

    great0
    2023-12-11 15:38:30
    xiaoshenzhen0
    2023-12-11 11:15:15
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论