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

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

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

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

    • index.html

使用方法

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

jquery页面定位滚动切换背景色插件

一款鼠标点击定位url自动显示对应内容,并且同时变更页面背景颜色,很不错的特效。
  其它&杂项
 181  

jquery列表数据可按shift/ctrl键实现多选功能插件

一款支持shift键多选功能插件,使用户可以一键选中所有相关的复选框和/或使用CTRL和Shift键选择多个复选框。
  其它&杂项
 201  

jquery鼠标滑动星星打分生活美食网站星级评分

一款在线打分评价插件,鼠标hover即时显示当前评分等级,点击选中评分。
  其它&杂项
 205  

jquery微博评论textarea表情解析插件

调用方法: $.emoticons(options,callback);
  其它&杂项
 216  

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

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