$(function(){ var a; var b = 1; $('.progres-numerical i').each(function(){ a = parseInt($(this).html()); if(a>b){ a=b; /*取最大值*/ } }) $('.progres-numerical i').each(function(){ var num_money = parseInt($(this).html()); var very_contrast = (num_money / b)*100 + "%"; $(this).parent('.progres-numerical').siblings('.progress-line').children('.progress-line-red').css({"width":very_contrast}) }); })