/**
*控制比例条以及比例显示
*/
function bilv(cell,data){
var total = $("#total").val();
if(total==0){
total=1;
}
var count = data["count"];
var a = count/total;
if(a>1){
a=1;
}
var pic = "<img width='"+148*a+"' height='10' src='../../../res/sites/images/red_precent.gif'><img width='"+148*(1-count/total)+"' height='10' src='../../../res/sites/images/qian_precent.gif'>";
var bil ="<a>"+Math.round(a*100)+"%</a>";
cell.html(pic+bil);
}
*控制比例条以及比例显示
*/
function bilv(cell,data){
var total = $("#total").val();
if(total==0){
total=1;
}
var count = data["count"];
var a = count/total;
if(a>1){
a=1;
}
var pic = "<img width='"+148*a+"' height='10' src='../../../res/sites/images/red_precent.gif'><img width='"+148*(1-count/total)+"' height='10' src='../../../res/sites/images/qian_precent.gif'>";
var bil ="<a>"+Math.round(a*100)+"%</a>";
cell.html(pic+bil);
}
本文介绍了一个用于前端开发的功能,该功能通过JavaScript实现动态更新比例条和百分比显示,适用于展示数据占比情况。
1054

被折叠的 条评论
为什么被折叠?



